ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [LAMP]Php-5.3.29编译安装

[LAMP]Php-5.3.29编译安装

原创 Linux操作系统 作者:梓沐 时间:2016-02-15 10:13:14 0 删除 编辑
环境参数: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 http://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz

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 http://cn2.php.net/get/php-5.3.29.tar.gz/from/this/mirror

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博客 ” ,链接:https://blog.itpub.net/29812844/viewspace-1988853/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
擅长PLS/QL开发,SQL调优和改写,数据库设计

注册时间:2014-08-18

  • 博文量
    161
  • 访问量
    1204424