First, install Apache
Yum-y Install httpd
/ETC/INIT.D/HTTPD start
Document Directory in/var/www/html
Second, install PHP
Yum-y Install PHP
Modify the Apache configuration file,/etc/httpd/conf/httpd.conf
The corresponding location appends the following:
LoadModule php5_module/usr/lib64/httpd/modules/libphp5.so
Additional
AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-php-source. Phps
DirectoryIndex additional index.php
Restarting the APACHE,/ETC/INIT.D/HTTPD restart will prompt
"Module Php5_module is already loaded, skipping", does not matter does not affect
However, if the PHP page can not be parsed, the browser displays the source code, it is added in the httpd.conf:
<ifmodule mod_php5.c>
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
</IfModule>
It should be good to restart Apache.
This article is from the "zl1030 Records" blog, so be sure to keep this source http://zl1030.blog.51cto.com/274507/1561977
Linux CentOS Installation Apache