All,
I am just trying to view any page at all besides the “Welcome to Zend Framework” screen.
I have downloaded the project from this tutorial: http://framework.zend.com/docs/quickstart/create-a-form (Zend Framework Quickstart)
As far as I can tell, the paths are coming up correctly. I read this post: http://www.johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/ I think it may be a bit dated, as the bootstrap code is not as he describes.
Does anyone have any ideas? I would think that the tutorial download from Zend should work out of the box.
Summary: http://localhost/ZendFrameworkQuickstart/public/ Displays: Zend welcome page
http://localhost/ZendFrameworkQuickstart/public/guestbook Displays: 404
Thanks!
UPDATE Physical path of the “public” directory: C:\Zend\Apache2\htdocs\ZendFrameworkQuickstart\public
URL I’m hitting from the browser: http://localhost/ZendFrameworkQuickstart/public/guestbook
.htaccess Contents:
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /ZendFrameworkQuickstart/Public/index.php [NC,L]
UPDATE: Changed lines in files
.htaccess RewriteRule ^.*$ /ZendFrameworkQuickstart/public/index.php [NC,L]
application.ini resources.frontController.baseUrl = "/ZendFrameworkQuickstart/public"
public/index.php error_reporting( E_ALL | E_STRICT ); ini_set( 'display_errors', 1 );
Finally figured it out. In the httpd.conf file for Apache, change every instance of "AllowOverride None" to "AllowOverride All."
I'm not sure why Zend didn't have this setup already, since my Zend Framework install setup Apache. After this change, the Quickstart ran as-is (and didn't even need to be in the root).
Thanks for all of the help!
Adding to Jacob's comment: I think the mod_rewrite conditions and rules in the .htaccess file for the Quickstart application expect everything to be relative to the root of the domain and particularly rewrites everything to the root of the domain (
/index.php
to be specific).So either:
Also, be sure you have mod_rewrite enabled on your server (assuming you have an apache server).
EDIT Since your application is not running from the root of your server you should probably still set the baseUrl somewhere in your bootstrap. With something like:
But you'll be saving yourself a lot of trouble to just circumvent this by putting your application in the root of your server, or let the root of your server point to the public folder in httpd.conf, if either of these options is available to you.
If you do this, be sure to put the .htaccess to it's default settings again.