Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Salut à tous,
Je suis en train de tester ZF avec OVH. Bon, j'ai lu ici meme des posts car cela posait des problemes. J'ai fais ce qu'il a été dit dans ces posts sans succes.
Je n'ai pas de controlleur "error", juste un indexController.php et une vue, rien de plus. C'est quand meme dingue.
- J'ai essayé de changer les liens dans ::run('.
- /index/ ne marche pas non plus
- Tout est en 755
-
Voici l'erreur :
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /homez.42/quoidaut/offline-shared/zf/library/Zend/Controller/Dispatcher/Standard.php:249 Stack trace: #0 /homez.42/quoidaut/offline-shared/zf/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /homez.42/quoidaut/offline-shared/zf/library/Zend/Controller/Front.php(226): Zend_Controller_Front->dispatch() #2 /homez.42/quoidaut/www/index.php(16): Zend_Controller_Front::run('../application/...') #3 {main} thrown in /homez.42/quoidaut/offline-shared/zf/library/Zend/Controller/Dispatcher/Standard.php on line 249
Voici l'arborescence :
Mvc:
/application/
/application/controllers/
etc...
Bootstrap:
/www/index.php
/www/.htaccess
ZF :
/offline-shared/zf/library/
Voici le code :
htacces:
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] SetEnv PHP_VER 5
index.php (bootstrap) :
<?php DEFINE ('_PATH_TO_ZF_','/homez.42/quoidaut/offline-shared/zf/library'); set_include_path("." .PATH_SEPARATOR._PATH_TO_ZF_ .PATH_SEPARATOR.get_include_path() ); require_once 'Zend/Controller/Front.php'; Zend_Controller_Front::run('../application/controllers');
Je suis paumé...
Merci de votre aide
Fabrice
Hors ligne
Pour moi ca marche chez OVH :
le .htaccess sous www
# Configuration serveur OVH # Force PHP5 SetEnv PHP_VER 5 # Désactive le paramètre register_globals SetEnv REGISTER_GLOBALS 0 # Désactive le paramètre magic_quotes_gcp SetEnv MAGIC_QUOTES 0 # Configuration Apache RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
bootstrap.php dans application un rep. plus haut que www
<?php // Step 1: Check to see if the applicaiton environment is already setup if (isset($bootstrap) && $bootstrap) { // Add our library directory to the include path so that set_include_path('../library' . PATH_SEPARATOR . get_include_path()); // Set up autoload require_once "Zend/Loader.php"; Zend_Loader::registerAutoload(); } // Get the front controller. $frontController = Zend_Controller_Front::getInstance(); // Point the front controller to your modules directory. $frontController->addModuleDirectory('../application/modules'); // Set up Layout MVC $options = array( 'layout' => 'layout', 'layoutPath' => '../application/layouts', 'contentKey' => 'content', ); Zend_Layout::startMvc($options); // Step 4: Set the current environment $frontController->setParam('env', 'development');
index.php a la racine www
<?php // Step 1: Set a flag indicating setup is necessary $bootstrap = true; // Step 2: Setup PHP environment // In this case, we will setup error reporting, but any ini_set or // environment-related directives should go here. This way, you can create a // separate PHP environment for running tests. error_reporting(E_ALL | E_STRICT); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); // Step 3: Perform application-specific setup // This allows you to setup the MVC environment to utilize. Later you can re-use // this file for testing your applications require '../application/bootstrap.php'; // Step 4: Dispatch the request using the front controller. // The front controller is a singleton, and should be setup by now. We will grab // an instance and dispatch it, which dispatches your application. Zend_Controller_Front::getInstance()->dispatch();
En espérant que ca puisse t'aider... C'etait pour tester....? basé sur un quickstart du zf 1.5.2 il me semble
Dernière modification par ManuB (03-10-2008 18:21:29)
Hors ligne
Salut,
Moi aussi ca fonctionne très bien aussi sur un hébergement mutualisé de chez OVH (60 gp). J'ai le meme .htaccess que ManuB. La seule différence, c'est que moi mon index c'est en meme temps mon bootstrap et que toute ma librairie zf se trouve sour le rep www. J'avais déjà pensé tester de mettre la librairie hors du www mais j'ai jamais eu l'occas (suis débutant aussi)
Vincent
Hors ligne
Merci de vos réponses, mais çà marche toujours pas . J'ai essayé pleins de choses différentes sans succès.
J'ai mis les url absolues, relatives, ton .htaccess, mais cela ne change rien
Fabrice
Hors ligne