你好,游客 登录 注册 搜索
背景:
阅读新闻

Centos5.7下编译安装php5.4.0

[日期:2012-03-19] 来源:  作者: [字体: ]
Centos5.7下编译安装php5.4.0,编译安装php-5.4.0 ,php5.4.0 Zend Guard Loader暂时不支持,等待zend官方更新。 
 
1.下载 
 
 
wget wget http://cn.php.net/distributions/php-5.4.0.tar.gz
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0"
wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&big_mirror=0"
wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&big_mirror=0"
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.7.5-9.tar.gz
wget http://pecl.php.net/get/imagick-3.0.1.tgz2.编译安装PHP 5.4.0所需的支持库 
 
 
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local
make
make install
cd ../
 
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../
 
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../
 
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
 
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../
 
3.编译mysql5.5.21
wget http://mysql.stu.edu.tw/Downloads/MySQL-5.5/mysql-5.5.21.tar.gz
 
wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
tar xvzf cmake-2.8.7.tar.gz
./configure
make
make install 
 
编译安装mysql
tar xvzf mysql-5.5.21.tar.gz
cd mysql5.5.21
rm CMakeCache.txt
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5.21/ \
-DMYSQL_DATADIR=/usr/local/mysql5.5.21/data \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.5.21/data/mysql.sock \
-DMYSQL_USER=mysql \
-DWITH_DEBUG=0
 
make && make install 4.编译php 
 
 
安装依赖包
yum install ncurses-devel libxml2-devel bzip2-devel libcurl-devel \
curl-devel libjpeg-devel libpng-devel freetype-devel net-snmp-devel
 
tar xvzf php-5.4.0.tar.gz
cd php-5.4.0
./configure --prefix=/usr/local/php5.4.0 --with-config-file-path=/usr/local/php5.4.0/etc \
--with-mysql=/usr/local/mysql5.5.21/ --with-mysqli=/usr/local/mysql5.5.21/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql5.5.21/ --with-iconv-dir=/usr/local --enable-fpm  \
--disable-phar --with-fpm-user=www-data --with-fpm-group=www-data --with-pcre-regex \
--with-zlib --with-bz2 --enable-calendar --with-curl --enable-dba --with-libxml-dir \
--enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir \
--enable-gd-native-ttf --enable-gd-jis-conv --with-mhash --enable-mbstring --with-mcrypt  \
--enable-pcntl  --enable-xml --disable-rpath  --enable-shmop --enable-sockets --enable-zip \
--enable-bcmath --with-snmp --disable-ipv6
 
make ZEND_EXTRA_LIBS='-liconv'
make test
make install
cp php.ini-production /usr/local/php5.4.0/etc/php.ini5.编译安装PHP5扩展模块 
 
 
tar zxvf memcache-3.0.5.tgz
cd memcache-3.0.5/
/usr/local/php5.4.0/bin/phpize
./configure --with-php-config=/usr/local/php5.4.0/bin/php-config
make
make install
cd ../
 
tar xvzf memcached-1.0.2.tgz
cd memcached-1.0.2
/usr/local/php5.4.0/bin/phpize
./configure --with-php-config=/usr/local/php5.4.0/bin/php-config
收藏 推荐 打印 | 阅读:
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数
点评:
       
评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款
相关新闻      
热门评论