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
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!