ZEND-FRAMEWORK2-Issues with setting up virtual paths when building PHP applications using the Zend FRAMEWORK2 framework

Source: Internet
Author: User
I am a novice php, just contact Zend FRAMEWORK2 Framework, there is a problem has been bothering me, is every time a new Zend2 project, to the Apache server 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
  
   

It bothers me that there are some more convenient ways to deal with the great God, and you can run the project on Zend Studio, without having to create a new virtual path each time and repeat the code above.

Hope to understand the ignorance of rookie, grateful!

PS: I was developed using Zend Studio, and it was created with the Zend2 project, and the server was using Apache local server.

Reply content:

I am a novice php, just contact Zend FRAMEWORK2 Framework, there is a problem has been bothering me, is every time a new Zend2 project, to the Apache server 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
  
   

It bothers me that there are some more convenient ways to deal with the great God, and you can run the project on Zend Studio, without having to create a new virtual path each time and repeat the code above.

Hope to understand the ignorance of rookie, grateful!

PS: I was developed using Zend Studio, and it was created with the Zend2 project, and the server was using 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'll be able to access your project through servername.

It is also recommended that Phpstorm be an appropriate 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.