Ist mod_rewrite denn aktiviert? Welches Betriebssystem läuft denn da drauf? Eine .htaccess könnte z.b. so aussehen (von meinem lokalen Apachen, environment kannst du ja setzen, wie du möchtest):
Code:
SetEnv APPLICATION_ENVIRONMENT development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Zitat:
|
Zu erwarten wäre hier eine Zend Exception bzw. eine Seite, wenn es den Controller gäbe.
|
Abhängig von deinen settings siehst du da nicht unbedingt etwas. Ich poste dir mal eine index.php:
PHP-Code:
<?php
ob_start();
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/'));
require_once (APPLICATION_PATH. "/../library/ExtZend/Debug.php");
$debug = Debug::getInstance();
$debug->trace('start');
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
defined('APPLICATION_ENVIRONMENT')
or define('APPLICATION_ENVIRONMENT', 'development');
define('HTMLPURIFIER_PREFIX', APPLICATION_PATH.'/../library');
set_include_path(
realpath(APPLICATION_PATH . '/../library')
. PATH_SEPARATOR . APPLICATION_PATH . '/models'
. PATH_SEPARATOR . get_include_path()
);
try {
require_once "Zend/Loader/Autoloader.php";
require_once "Zend/Loader.php";
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace(
array(
'Xyz_'
,'ExtZend_'
)
);
$loader->pushAutoloader(array("ExtZend_Autoloader", "autoload"));
require_once APPLICATION_PATH . '/Bootstrap.php';
require_once 'Zend/Application.php';
$application = new Zend_Application(
APPLICATION_ENVIRONMENT,
APPLICATION_PATH . '/config/general.ini'
);
$application->bootstrap()->run();
} catch (Exception $exception) {
echo 'Leider ist ein Fehler aufgetreten!';
if (defined('APPLICATION_ENVIRONMENT')
&& APPLICATION_ENVIRONMENT != 'production'
) {
echo '<br /><br />' . $exception->getMessage() . '<br />'
. '<div align="left">Stack Trace:'
. '<pre>' . $exception->getTraceAsString() . '</pre></div>';
}
}
ob_end_flush();
#$debug->toFile("",true);
Eine settings.ini kann z.b. so aussehen:
Code:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
phpSettings.date.timezone = "Europe/Berlin"
database.adapter = pdo_mysql
database.params.host = localhost
database.params.username = ***
database.params.password = ***
database.params.dbname = ***
database.params.driver_options.1002 = "SET NAMES utf8"
resources.layout.layoutpath = APPLICATION_PATH "/layouts"
autoloadernamespaces.extzend = "ExtZend_"
autoloadernamespaces.xyz = "Xyz_"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
[staging : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
phpSettings.error_reporting = E_ALL ^ E_NOTICE
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
phpSettings.error_reporting = E_ALL ^ E_NOTICE
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
phpSettings.error_reporting = E_ALL | STRICT
Und hier noch ein ein verkürztes bootstrapping:
PHP-Code:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected $_config;
protected function _initConfig()
{
$this->_config =
new Zend_Config_Ini(
APPLICATION_PATH . '/config/general.ini'
, APPLICATION_ENVIRONMENT
);
Zend_Registry::set('config', $this->_config);
Zend_Registry::set('env', APPLICATION_ENVIRONMENT);
return $this->_config;
}
protected function _initAutoload()
{
$moduleLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH));
return $moduleLoader;
}
protected function _initFrontController()
{
$this->bootstrap("config");
$frontController = Zend_Controller_Front::getInstance(
$this->_config->resources->frontController->toArray()
);
$frontController->setControllerDirectory(
array(
'booking' => APPLICATION_PATH . '/modules/booking/controllers',
'admin' => APPLICATION_PATH . '/modules/admin/controllers',
)
);
$frontController->setParam('env', APPLICATION_ENVIRONMENT);
$frontController->setDefaultModule("booking");
Zend_Controller_Action_HelperBroker::addPath(
'Xyz/Controller/Action/Helper',
'Helper'
);
return $frontController;
}
protected function _initPlugins() {
$this->bootstrap("FrontController");
$frontController = $this->getResource('FrontController');
$frontController->registerPlugin(new Xyz_Plugin_SetLayout());
$frontController->registerPlugin(new Xyz_Plugin_Ajax());
}
protected function _initRequest()
{
$this->bootstrap('FrontController');
$frontController = $this->getResource('FrontController');
$request = new Zend_Controller_Request_Http();
$frontController->setRequest($request);
return $request;
}
protected function _initDatabase()
{
$this->bootstrap("config");
$adapter = $this->_config->database->adapter;
$params = $this->_config->database->params->toArray();
$dbA = Zend_Db::factory($adapter, $params);
$dbA->setFetchMode(Zend_Db::FETCH_OBJ);
Zend_Registry::set('Zend_Db', $dbA);
Zend_Db_Table_Abstract::setDefaultAdapter($dbA);
if("production" !== APPLICATION_ENVIRONMENT) {
$dbA->getProfiler()->setEnabled(true);
}
return $dbA;
}
protected function _initView()
{
$layout = Zend_Layout::startMvc();
Zend_Registry::set('Layout', $layout);
$doctypeHelper = new Zend_View_Helper_Doctype();
$doctypeHelper->doctype(Zend_View_Helper_Doctype::XHTML1_TRANSITIONAL);
return $layout->getView();
}
public function run ()
{
$frontController = $this->getResource('FrontController');
$frontController->dispatch();
}
}
Eine vhost conf noch:
Code:
<VirtualHost *:80>
DocumentRoot /home/basti/pages/
ServerName pages
ServerAlias 127.0.0.1
DirectoryIndex index.html index.php
<Directory "/home/basti/pages">
Options +Indexes
Order allow,deny
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
Das ist in etwa mein lokales setup. Damit solltest du das ZF zum laufen kriegen
viel Erfolg
Basti