Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour,
J'ai un projet simple qui fonctionne très bien. Mais lorsque que je crée un nouveau Controller j'ai un 404 quand je veux accéder à la page correspondante.
Mon .access:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] SetEnv APPLICATION_ENV development AllowOverride All
J'ai bien décommenté le mode rewrite du httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so
et mis allow Override All:
<Directory /> Options FollowSymLinks AllowOverride All Order deny,allow Deny from all </Directory>
Dans le error.log de /private/var/log/apache2 j'ai :
File does not exist: /Users/xxxx/Sites/PHPProjects/tutoriel-zf/public/auth
Après pas mal de recherche sur le net j'avoue que je sèche un peu. Si parmi vous certains arrivent à me mettre sur la voie...
Dans mon httpd.conf j'ai:
DocumentRoot "/Library/WebServer/Documents"
, j'ai lu que la valeur de DocumentRoot pouvait avoir un role pour le 404. Je ne sais quelle valeur lui affecter, je dois la laisser comme elle est?
Merci d'avance!
PS : Je suis sous Mac.
Dernière modification par tomy29 (19-05-2012 11:25:27)
Hors ligne
Dans quel dossier se trouve ton fichier index.php ?
Peut-on voir ton arborescence ?
Hors ligne
Hors ligne
Je ne sais pas ce que cette instruction veut dire, je n'y ai pas touché.
Hors ligne
Oui déjà remplace Deny from all par Allow from all. Ensuite le document root doit pointer sur ton dossier public.
Ton fichier .htaccess doit aussi se trouver dans le dossier public.
Dernière modification par alien7 (17-05-2012 20:46:18)
Hors ligne
Ok,
En fait dans httpd.conf j'ai plusieurs occurrences de AllowOverride None , du coup je ne sais pas si j'ai changé None en All au bon endroit.
Pour le DocumentRoot, il doit pointer vers le Public de mon projet? Idem j'ai plusieurs fois DocumentRoot dans httpd.conf, du coup je ne sais pas lequel modifier. J'ai tenté de le modifier pour qu'il pointe sur public, mais là le 404 se fait meme quand je suis dans Public dans mon navigateur.
Hors ligne
Pour info, dans httpd.conf j'ai changé cette occurrence AllOverride:
<Directory "/Library/WebServer/Documents">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks MultiViews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Pour DocumentRoot, si je change
DocumentRoot "/Library/WebServer/Documents"
en
DocumentRoot "/Users/xxxxx/Sites/PHPProjects/tutoriel-zf/public"
J'ai l'erreur:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Dernière modification par tomy29 (17-05-2012 23:02:28)
Hors ligne
petit update :
si je fais http://localhost/~tlecorre/PHPProjects/tutoriel-zf/public/index.php/auth
alors ca fonctionne.
Hors ligne
Bon, j'ai finalement réglé le problème. Je ne sais pas si c'était la bonne façon de faire, mais ça a l'air de fonctionner.
Je n'avais pas de virtual host déclaré pour mon site.
J'en ai donc créé un dans le fichier httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin mon-email@domaine.com
DocumentRoot /Users/xxxx/Sites/PHPProjects/zf-auth-tutorial/
ServerName zf-auth
<Directory /Users/xxxx/Sites/PHPProjects/zf-auth-tutorial/>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Hors ligne