install zend framework without apache virtual host

2020-03-25 07:32发布

I have my website in /var/www/invent. I have zend-framework in /var/www/invent/library.

Basically what i want is when i access http://localhost/invent to work as if i had a virtual host "invent" defined in apache conf file (like accessing http://invent). How can I achieve this? I have developed my project under windows, having virtual hosts set up but I don't want to continue working like this because i cannot deploy my app on public webhosting services that do not allow me to create virtual hosts. Not to mention that if I deploy an app on a LAN, i need to configure the client's hosts file as well... Please help, this is the most annoying thing with zend (haven't tried other frameworks so far though).

2条回答
等我变得足够好
2楼-- · 2020-03-25 07:58

Your application document root is wherever you place your index.php file, the locations of the Zend Framework library and your application code are irrelevant.

Provided you've used the BaseUrl helper in your views for static assets (JavaScript, CSS, images) and the Url helper for action links, your application should be very portable in regards to relative path from the web server document root.

Let me know if I'm way off track here. Your question could do with some more details.

查看更多
手持菜刀,她持情操
3楼-- · 2020-03-25 08:06

remove vhost property and go directly to http://localhost/yourproject/public folder. You will need to stay with htaccess mod_rewrite , don't delete mod_rewrite properties in htaccess

查看更多
登录 后发表回答