This article is used to remember the whole two days of the lamp environment, if the PHP is not required to recommend all with Yum one-click installation, purely personal experience, the main role is for reference.
Yum Install httpd #yum installs Apache.
PHP Compilation Installation
Remember to install PHP dependent environment before installing
Yum installs PHP5.6 's dependent environment
Yum-y install gcc gcc-c++ libxml2 libxml2-devel
PHP5.6.2 Download Path
wget http://mirrors.sohu.com/php/php-5.6.2.tar.gz
/configure--prefix=/usr/local/php \ #PHP安装路径
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \ #--with-apxs2 pointing to Apache's APXS path
--with-config-file-path=/usr/local/php/etc #PHP配置文件路径
--ENABLE-FPM--enable-mbstring--enable-gd--enable-xml #加载fpm, mbstring module
--with-mysql=/usr/local/mysql #支持MySQL replaced with the MySQL path.
Make && make install #有需要的PHP拓展的自己编译的时候加上.
Copy the PHP configuration file.
CP Php-5.6.2/php.ini-development/usr/local/php/etc/php.ini
Modify the Apache configuration file httpd.conf
DirectoryIndex index.html index.php #添加index. php
Found it:
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add the following content
AddType Application/x-httpd-php-source. Phps
AddType application/x-httpd-php. php
Check if LoadModule php5_module modules/libphp5.so has added libphp5.so file exists
Write the test file index.php content as follows, put in Apache's default Web site Directory documentroot #默认路径/var/www/html
<?php
Phpinfo ();
?>
Start the Apache service, if it fails to start, review the configuration file httpd.conf, locate the error log error.log, and modify it for the issue.
Service httpd Restart
With the browser access to the http://IP/, you can see the PHP configuration to indicate that you have succeeded.
Linux under Apache support PHP configuration