Zend-framework2-questions about setting virtual paths when building php applications using the zendframework2 framework

Source: Internet
Author: User
I am a beginner in php and I have just come into contact with the zendframework2 framework. One problem that has always plagued me is that every time I create a zend2 project, to the apache server http-vhosts.conf to write a few lines similar to the following code: {code ...} this makes me very troubled... I am a beginner in php and I have just come into contact with the zend framework2 framework. One problem that has always plagued me is that every time I create a zend2 project, to the apache server http-vhosts.conf to write a few lines similar to the following code:


  
       ServerAdmin webmaster@dummy-host2.example.com    DocumentRoot "D:/Program Files/xampp/htdocs/project/php"    ServerName php    SetEnv APPLICATION_ENV development   ErrorLog "logs/php.com-error.log"   CustomLog "logs/php.com-access.log" common
  

This left me a lot of trouble. Do you have some convenient solutions? You can run a project on zend studio, instead of creating a virtual path every time, repeat the following code.

I hope to understand cainiao's ignorance and I am grateful!

PS: I used zend studio for development and also used it for zend2 project creation. The server uses the apache local server.

Reply content:

I am a beginner in php and I have just come into contact with the zend framework2 framework. One problem that has always plagued me is that every time I create a zend2 project, to the apache server http-vhosts.conf to write a few lines similar to the following code:


  
       ServerAdmin webmaster@dummy-host2.example.com    DocumentRoot "D:/Program Files/xampp/htdocs/project/php"    ServerName php    SetEnv APPLICATION_ENV development   ErrorLog "logs/php.com-error.log"   CustomLog "logs/php.com-access.log" common
  

This left me a lot of trouble. Do you have some convenient solutions? You can run a project on zend studio, instead of creating a virtual path every time, repeat the following code.

I hope to understand cainiao's ignorance and I am grateful!

PS: I used zend studio for development and also used it for zend2 project creation. The server uses the apache local server.

This is the configuration of apache httpd-vhosts.
The key is to understand DocumentRoot and ServerName.
Point ServerName to 127.0.0.1 In the hosts file and you will be able to access your project through ServerName.

PhpStorm is recommended as an IDE.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.