[LAMP]Php-5.3.29編譯安裝

梓沐發表於2016-02-15
環境引數:Linux:Centos6.5,php:5.3.29,libiconv:1.14

1.必要軟體安裝準備
yum install zlib zlib-devel libxml libxml2-devel libjpeg libjpeg-devel freetype freetype-devel libpng libpng-devel gd gd-devel curl curl-devel libxslt libxslt-devel -y

2.下載libiconv,下載地址:wget

3.編譯安裝libiconv
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make && make install

4.下載Php,下載地址:sudo wget

5.解壓Php
tar xf php-5.3.29.tar.gz
cd php-5.3.29

6.編譯Php
./configure \
--prefix=/application/php5.3.29 \
--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

7.安裝Php
make && make install

8.使Apache支援Php
vim /application/apache/conf/httpd.conf

加入如下紅字內容
<IfModule dir_module>
   DirectoryIndex index.php index.html
</IfModule>


AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29812844/viewspace-1988853/,如需轉載,請註明出處,否則將追究法律責任。

相關文章