Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour
J'ai suivi le tutorial quick start officiel du zf (http://framework.zend.com/wiki/display/ … QuickStart), cependant chez moi l'exemple ne marche pas !
J'ai suivi scrupuleusement le tutorial et j'ai vérifié 6 fois d'avoir tout fait correctement en repartant a chaque fois de zero a differentes periodes
J'obtiens cependant a chaque fois la meme erreur :
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (Zend%20Framework%201.5.2)' in E:\Programmation\Web\Zend Framework 1.5.2\library\Zend\Controller\Dispatcher\Standard.php:249 Stack trace: #0 E:\Programmation\Web\Zend Framework 1.5.2\library\Zend\Controller\Front.php(914): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 E:\Programmation\Web\Zend Framework 1.5.2\application\bootstrap.php(22): Zend_Controller_Front->dispatch() #2 E:\Programmation\Web\Zend Framework 1.5.2\public\index.php(2): require('E:\Programmatio...') #3 {main} thrown in E:\Programmation\Web\Zend Framework 1.5.2\library\Zend\Controller\Dispatcher\Standard.php on line 249
j'utilise wampserver (php 5.2.6, windows xp) et cette erreur me desespere
toute aide serait grandement apprécié
merci
Edit Philippe : balises code
Dernière modification par Bouki (21-07-2008 19:46:28)
Hors ligne
Tu peux nous envoyer
* l'url que tu appelles
* ton bootstrap.php
* ton index.php
Sinon pense à mettre ton code et des exceptions dans des balises code et /code pour faciliter la lecture dans le forum.
A+, Philippe
Hors ligne
désolé pour la balise code, ca ne m'était pas venu à l'idée de l'utiliser pour un message d'erreur (assez long c'est vrai )
public/index.php
<?php require '../application/bootstrap.php';
application/bootstrap.php
<?php /* Report all errors directly to the screen for simple diagnostics in the dev environment */ error_reporting(E_ALL | E_STRICT); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); /* Add the Zend Framework library to the include path so that we can access the ZF classes */ set_include_path('../library' . PATH_SEPARATOR . get_include_path()); /* Set up autoload so we don't have to explicitely require each Zend Framework class */ require_once "Zend/Loader.php"; Zend_Loader::registerAutoload(); /* Set the singleton instance of the front controller */ $frontController = Zend_Controller_Front::getInstance(); /* Disable error handler so it doesn't intercept all those errors we enabled above */ $frontController->throwExceptions(true); /* Point the front controller to your action controller directory */ $frontController->setControllerDirectory('../application/controllers'); /* OK, do your stuff, front controller */ $frontController->dispatch();
application/controllers/IndexController.php
<?php /** @see Zend_Controller_Action */ require_once 'Zend/Controller/Action.php'; class IndexController extends Zend_Controller_Action { public function indexAction() { } }
application/views/scripts/index/index.phtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Zend Framework Quick Start</title> </head> <body> <h1 align="center"><?php echo 'Hello, Zend Framework MVC!' ?></h1> </body> </html>
le tout est situé sur E:\Programmation\Web\Zend Framework 1.5.2\
appelé par http://localhost/Zend%20Framework%201.5.2/public/
Hors ligne
Bonjour,
Il faut définir le baseUrl quand tu ne mets pas ton site à la racine de ton apache :
dans ton bootstrap.php, il faut ajouter la ligne :
$frontController->setBaseUrl("/Zend%20Framework%201.5.2/public/");
peut-être qu'il ne faut pas mettre les échappements, je n'ai jamais essayé avec des espaces dans l'URL...
A+, Philippe
Hors ligne
merci beaucoup , cela marche tel que tu me l'a donné.
je ne pensais pas qu'il était nécessaire d'appeler une méthode setBaseUrl d'autant que dans le tutorial il n'en est fait aucunement mention, en tout cas un grand merci, je vais enfin pouvoir commencer a apprendre
Hors ligne
Pages: 1