Can apache parse php?

王林
Release: 2019-10-17 11:44:33
Original
3044 people have browsed it

Can apache parse php?

1. Start the httpd service

/usr/local/apache2.4/bin/apachectl start
Copy after login

2. Modify the configuration file

cp /usr/local/apache2.4/conf/httpd.conf /usr/local/apache2.4/conf/httpd.conf.bak  
//修改任何配置文件,先拷贝一份副本
 
vim /usr/local/apache2.4/conf/httpd.conf +195
   ServerName www.example.com:80	//在任意处新增一段ServerName
Copy after login

3. After we modify the configuration file, we need Check if there are any syntax errors and then restart etc.

/usr/local/apache2.4/bin/apachectl -t	//使用-t检查语法,出现Syntax OK 说明配置文件没有错误
Copy after login

4. Write a php test script to check whether httpd can parse the php page (the default page storage path is /usr/local/apache2.4/ htdocs directory)

 vim /usr/local/apache2.4/htdocs/test.php	
   <?php
   phpinfo();
   ?>
Copy after login

Recommended tutorial: apache tutorial

The above is the detailed content of Can apache parse php?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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