您的位置:首页 > 编程语言 > PHP开发

ubuntu下编译安装php5.4

2015-07-28 17:13 716 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: