Home >Operation and Maintenance >Apache >Can apache parse php?

Can apache parse php?

王林
王林Original
2019-10-17 10:50:413095browse

Can apache parse php?

1. Start the httpd service

/usr/local/apache2.4/bin/apachectl start

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

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 说明配置文件没有错误

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();
   ?>

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!

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