Home  >  Article  >  Backend Development  >  How to set up a site in php

How to set up a site in php

coldplay.xixi
coldplay.xixiOriginal
2020-08-14 15:47:436132browse

How to set up the site in php: first open the file [httpd-vhosts.conf] and add the relevant code; then find the file [httpd.conf] and remove the [#] before [#Include conf/] ;Finally set the site name.

How to set up a site in php

php method to set up the site:

1. First open apache\httpd-2.4.39-win64- In the httpd-vhosts.conf file under the VC15\Apache24\conf\extra folder, add the following code at the end, and modify the parameters according to the comments.

#站点,8089为端口号名称
<VirtualHost *:8089>
   #站点名、服务器名
   ServerName localhost
   #站点位置
   DocumentRoot "E:\ProjectWork\phpProject"
   <Directory "E:\ProjectWork\phpProject">
   #当请求没有指定文件的时候,显示目录
   Options Indexes
   #启用文件夹访问控制的文件.htaccess设置
   AllowOverride All
   Order allow,deny
   allow from all
   #请求控制
   Require all granted
   #默认页面,第一个最优先
   DirectoryIndex index.php index.html
   </Directory>
</VirtualHost>

2. Find the httpd.conf file under the apache\httpd-2.4.39-win64-VC15\Apache24\conf file and #Include conf/extra/httpd-vhosts.conf Remove the # in front, which means it is enabled. Use the conf/extra/httpd-vhosts.conf file.

3. At the end of the C:\Windows\System32\drivers\etc\hosts file, find it as shown in the figure below

How to set up a site in php

4. The site configuration is completed.

Related learning recommendations: php programming (video)

The above is the detailed content of How to set up a site 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
Previous article:How to log PHP errorsNext article:How to log PHP errors