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
./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
相关文章推荐
- PHP实现简单的新闻发布系统实例
- 正则笔记-匹配域名和SRC
- php A*从迷宫迈向光明
- [php] 二维码
- php面向对象之final static const关键字的使用
- PHP编译动态文件
- 下载文件的php代码
- hdu 1089 A+B for Input-Output Practice (I)
- PHP的$_GET[]与$_POST[]的使用方法相关
- yourphp二次开发目录
- php 丢失 msvcr110.dll的解决!
- php按键跳转网页
- stagefrightplayer调用过程2
- php错误解决
- 搞不清FastCgi与PHP-fpm之间是个什么样的关系
- 如何实现php图片等比例缩放
- 坑爹的BOM PHP
- stagefrightplayer调用过程
- php 文件下载
- 分页小改进