Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour j'ai une petite question en ce qui concerne l'arborescence pour zend, je souhaite changer "http://localhost/Porjet/public/index/index " par "http://localhost/Projet/index/index",après une petite expérience avec ce framework je pense que c'est un problème sans solution par l'importance du dossier "Public" mais malgré tout je souhaite votre aide,en plus je ne cherche pas à utiliser Zend_route pour chaque page et c'est ici la difficulté.
Quand je déplace mon "index.php" et ".htaccess" du dossier "Public "au "/Projet " il m'affiche cette erreur :
Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\Projet\index.php on line 18 Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path=';.;C:\php5\pear') in C:\wamp\www\Projet\index.php on line 18
Bien sur il ne connait pas le chemin vers librairie et voilà mon "index.php" :
<?php // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), get_include_path() ))); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap() ->run();
Merci.Nll
Dernière modification par elec (27-01-2010 13:49:17)
Hors ligne
En effet, il suffit de définir l'alias de ton site "Projet" directement sur le répertoire Public dans le fichier de configuration du serveur Apache. De ce fait, tu pourras avoir l'URL : "http://localhost/Projet/index/index".
Exemple dans le httpd.conf :
<Directory "C:\www\Projet\public"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> Alias /Projet "C:\www\Projet\public"
Et un petit RewriteBase dans ton fichier .htaccess :
SetEnv APPLICATION_ENV development RewriteEngine On RewriteBase /Projet/ RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
@+
Stéphan.
Dernière modification par StefC30 (27-01-2010 15:09:41)
Hors ligne
Bonsoir,
Oui,merci pour vos réponse,c'est vraiment cela la solution que je cherche.Merci.
A+.Nll
Hors ligne
Bonjour,
je voulais savoir si la création de mon vhost était correct?
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/quickstart/public"
ServerName quickstart.locale
ErrorLog "/error/error.log"
<Directory "C:/Program Files/Zend/Apache2/htdocs/quickstart/public/">
Options Indexes FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
SetEnv APPLICATION_ENV development
</VirtualHost>
J'ai déclare dans le etc/host 127.0.0.1 quickstart.locale
Par contre j'arrive bien à aller sur l'index mais des que j'essaye de faire quickstart.locale/guestbook j'obtiens une erreur 404
Merci
Hors ligne