There is a case when you have already setup your apache and php to specific DocumentRoot and Directory. But then you want to create a project which use Zend Framework.
For example you have already defined your DocumentRoot “D:/Project” And then you naturally will change the < Directory "D:/Project" > also.
Therefore when you want to add Zend Framework into it, it will never work (at least that is happening to me. )
Zend Framework require this kind of structure Zend
QuickStart/
—-application/
—-controllers/
—-views/
——–scripts/
—-library/
—-www/ —> this is your public directory that is accessible to the outside world.
Then you should edit your httpd.conf. Add VirtualHost definition into it.
e.g Listen 1010
< VirtualHost *:1010 > DocumentRoot “D:/Project/ZendQuickStart/www” < /VirtualHost >
Restart the server and type “http://localhost:1010″ in your browser. Voila, it works.
One more thing, Zend Framework use .htaccess therefore you should check your “AllowOverride” inside your httpd.conf. If the “AllowOverride” is set to “None”, then there is no way that it’s gonna work.
You should change “None” to “All” (at least I use All, I have not investigated why…but it works for now…later on I have to remind myself to investigate it.). So, you can have many “DocumentRoot” in your localhost, and you don’t have to be worry to edit the httpd.conf everytime you want to switch from your Project folder to ZendProject folder.