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

How to set project virtual path in php

藏色散人
Release: 2023-03-04 19:50:01
Original
2694 people have browsed it

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 , and add the following code after :

#虚拟目录节点
<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>
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template