ubuntu下编译安装php5.4

1、编译参数

./configure  --prefix=/usr/local/php5.4  --enable-fpm  --enable-fastcgi --enable-force-CGI-redirect --with-config-file-path=/usr/local/php5.4/etc --with-mcrypt=/usr/local/libmcrypt  --with-zlib  --enable-mbstring   --with-mysql  --with-mysqli  --with-mysql-sock --with-mhash  --enable-soap  --with-gd  --with-jpeg-dir=/usr/local/jpeg  --enable-gd-native-ttf  --enable-pdo  --with-pdo-mysql  --with-gettext  --with-curl  --enable-sockets  --enable-bcmath   --with-bz2  --with-gettext   --enable-zip --with-openssl --enable-sockets

2、可能遇到的错误的处理

提示bzip2缺失

sudo apt-get install libbz2-dev
configure: error: Please reinstall the libcurl distribution -
sudo apt-get install libcurl3-dev
configure: error: jpeglib.h not found.
再次编译,遇到问题:configure: error: jpeglib.h not found. 解决办法:
(1)去网站 http://www.ijg.org/ 下载源码。我用的版本是jpegsrc.v8d.tar.gz,执行命令:sudo tar -zxvf jpegsrc.v8d.tar.gz -C /usr/src
(2)进入/usr/src/jpegsrc.v8d目录,sudo方式执行命令:sudo ./configure --prefix=/usr/local/jpeg;make;make install;
(3)重新编译php,增加参数--with-jpeg-dir=/usr/local/jpeg
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
 (1)去网站http://mcrypt.hellug.gr/lib/index.html 的下载源码,我下的版本是libmcrypt-2.5.7.tar.gz;执行命令:sudo tar -zxvf libmcrypt-2.5.7.tar.gz -C /usr/src
 (2)进入/usr/src/libmcrypt-2.5.7目录,sudo方式执行命令:./configure prefix=/usr/local/libmcrypt/;make ;make install 
 (3)重新编译php,这时增加参数--with-mcrypt=/usr/local/libmcrypt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值