First, the experimental environment
CentOS6.5
Software: php-5.3.27.tar.gz
Second, the experimental steps
1, PHP Installation Preparation
1) PHP Dependent package Installation Preparation
Yum-y install zlib libxml libjpeg freetype libpng gd Curl libiconv zlib-devel libxml2-devel libjpeg-devel Freetype-dev El Libpng-devel Gd-devel Curl-devel
Yum-y Install Libxslt-devel
Yum-y Install Openssl-devel
Tar zxf libiconv-1.14.tar.gz
CD libiconv-1.14
./configure--prefix=/usr/local/libiconv
Make
Make install
2. Install PHP
1) Unzip the php-5.3.27
Tar XF php-5.3.27
2) Compile and install PHP
CD php5.3.27
./configure \
--prefix=/application/php5.3.27 \
--WITH-APXS2=/APPLICATION/APACHE/BIN/APXS \
--with-mysql=/application/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-curl \
--with-xsl \
--ENABLE-FTP \
--with-libxml-dir
Make && make install
Ln-s/applcation/php5.3.27/application/php
3) Copy the configuration file to/application/php/lib/php.ini
Cp/home/chen/tools/php-5.3.27/php.ini-production/application/php/lib/php.ini
3. Configure Apache to support PHP
1) in/application/apache/conf/httpd.conf configuration file AddType application/x-compress. Z/addtype application/x-gzip. gz. Tgz followed by the following two lines:
AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-php-source. Phps
2) plus home file index.php
<ifmodule dir_module>
DirectoryIndex index.php index.html
</IfModule>
3) If you modify the following two items, you need to create a user and authorize
User Daemon
Group Daemon
User Daemonchen
Group Daemonchen
Useradd daemonchen-s/sbin/nologin/-M
Chown-r daemonchen.daemonchen/var/html/www/
4) write a test file index.php to the root of the site and then access it in a homogeneous browser.
<?php
Phpinfo ();
?>
After completing the appeal steps:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/82/D8/wKioL1dibL_CNoFAAAvlcd9NZ-A032.png-wh_500x0-wm_3 -wmp_4-s_949112116.png "title=" Phpinfo "alt=" Wkiol1dibl_cnofaaavlcd9nz-a032.png-wh_50 "/>
This article is from "Wake up your not alarm clock but dream" blog, please be sure to keep this source http://purify.blog.51cto.com/10572011/1789986
Compiling and installing php-5.3.27