How to change the location of `web root` folder of EasyPHP?

后端 未结 4 808
梦毁少年i
梦毁少年i 2021-02-20 06:19

Currently on my Windows 7 machine, it is C:\\Program Files (x86)\\EasyPHP-5.3.8.1\\www

I want to point it into another location on drive D, says D:\\c

相关标签:
4条回答
  • 2021-02-20 06:52

    You need to right click on the icon on the Easyphp icon on the taskbar and select configuration->Apache. This will open httpd.conf in a notepad window.

    You need to modify it as follows:

    DocumentRoot "D:/code"
    (...)
    # DocumentRootDirectory 
    <Directory "D:\code">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
     </Directory>
     (...)
     NameVirtualHost 127.0.0.1
     <VirtualHost 127.0.0.1>
       DocumentRoot "D:/code/"
       ServerName localhost
     </VirtualHost>
    
    0 讨论(0)
  • 2021-02-20 07:06

    Thanks to @daviddlh 's answer, I have the simple solution for my question.

    Open apache configuration file httpd.conf

    Replace the default value ${path}/www by the path of our choice, says D:\code

    Where does it come from? Look for DocumentRoot in apache config file (i.e. httpd.conf), we will see the below line which link us to ${path}/www

    DocumentRoot "${path}/www"
    
    0 讨论(0)
  • 2021-02-20 07:06

    Actually, if your apache is using Virtual Hosts, you just have to change the path under the correct "Virtual Host". In my case, it was:

    # Virtual Hosts
    ## Virtualhost localweb
    <VirtualHost 127.0.0.1>
    #   DocumentRoot "${path}/data/localweb"
        DocumentRoot "D:\Code"
        ServerName 127.0.0.1
    #   <Directory "${path}/data/localweb">
        <Directory "D:\Code">
            Options FollowSymLinks Indexes
            AllowOverride All
            Order deny,allow
            Allow from 127.0.0.1
            Deny from all
            Require all granted
        </Directory>
    </VirtualHost>
    
    0 讨论(0)
  • 2021-02-20 07:07

    Right click the EasyPHP icon, and select Configuration, then Apache. In httpd.conf, do a find for DocumentRoot. My folder is C:\php. Change these two lines:

    1. DocumentRoot "C:\php"

    2. <Directory "C:\php"> (the first one just below DocumentRoot...)

    Once you have changed C:\php to wherever your directory is, right click the EasyPHP icon again and restart.

    My apologies, same answer as above. Did not see it until writing this. :-(

    0 讨论(0)
提交回复
热议问题