After installing PHP, you can parse some dynamic pages, this article uses the source scheme to install PHP, the installation version is 5.3.10.
PHP is installed on top of Apache and MySQL, and readers can refer to the installation articles for Apache and MySQL.
Check the Lib library required for PHP installation
Rpm-qa zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel
Installing LIB Libraries
Yum Groupinstall "x software Development"
Yum-y Install zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel
Installing the Libiconv Library
wget http://ftp.gnu.org/pub/pub/gnu/libiconv/libiconv-1.14.tar.gz
Also need to install OpenSSL and openssl-devel yum install libxslt-devel*-y
./configure--prefix=/usr/local/libiconv/libiconv
Make&&make Install
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--WITH-XMLRPC \
--WITH-OPENSSL \
--with-zlib \
--with-freetype-dir \
--WITH-GD \
--with-jpeg-dir \
--with-png-dir \
--with-iconv=/usr/local/libiconv \
--enable-short-tags \
--enable-sockets \
--enable-zend-multibyte \
--ENABLE-SOAP \
--enable-mbstring \
--enable-static \
--ENABLE-GD-NATIVE-TTF \
--with-xsl \
--ENABLE-FTP \
--with-libxml-dir
Mak&&make Install
Add a few more parameters for Nagios's PHP environment
--enable-sigchild \
--ENABLE-PCNTL \
--enable-bcmath
I am in the implementation of the configuration process, there are some errors, but also found on the Baidu solution, the actual system is different, there may be a different situation.
Php.ini* is a PHP configuration file
Copy the production version's configuration file to the PHP installation directory
CP Php.ini-production/usr/local/php/lib/php.ini
Configure Apache to support PHP
Modify Apache config file httpd.conf add two lines
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
AddType application/x-httpd-php. php. php3
AddType Application/x-httpd-php-source. Phps
[[email protected] conf]# grep php httpd.conf
LoadModule Php5_module modules/libphp5.so
PHP module in front of the PHP configuration using the DSO method, the PHP module written to the Apache configuration
Add index.php to the default site home page location
In the Apache master configuration file
</IfModule>
# ' Main ' server configuration
#
..... skipping ...
DirectoryIndex index.php index.html
</IfModule>
After the installation of PHP can be in the default site directory to write a PHP file, and then restart the Apache service, through the browser to access.
Linux Web server Build-php article