httpd.conf" file in the apache directory; then modify and add the code to "Alias ​​/php "F:/phpspace" " Can."/> httpd.conf" file in the apache directory; then modify and add the code to "Alias ​​/php "F:/phpspace" " Can.">

Home  >  Article  >  Backend Development  >  How to set project virtual path in php

How to set project virtual path in php

藏色散人
藏色散人Original
2020-08-20 09:42:522604browse

How to set the project path in php: First open the "conf->httpd.conf" file in the apache directory; then modify and add the code to "Alias ​​/php "F:/phpspace"" That’s it.

How to set project virtual path in php

Recommended: "PHP Video Tutorial"

Configuring the project virtual path in php

To set the php virtual directory, open the conf->httpd.conf file in the apache directory, find 794ea01c23a0d5c1a7b2f169e4879de9, and add the following code after 2071f931c9870be1bebed0bdda8305e7:

#虚拟目录节点
<IfModule dir_module>
    #设置欢迎界面
    DirectoryIndex index.php index.html index.htm
    Alias  /php  "F:/phpspace"     
#介绍“/php”是虚拟路径,"F:/phpspace" 是你项目存放的物理路径;
   <Directory "F:/phpspace">
#访问权限设置
   Order allow,deny
   Allow from all
</Directory>
</IfModule>

After setting, save the file, restart apache, and access the project in the "F:/phpspace" directory through http://localhost/php/project name.

The above is the detailed content of How to set project virtual path in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn