时间:2021-07-01 10:21:17 帮助过:13人阅读
第一步,安装依赖包:
yum -y install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel libaio
要安装mcrypt扩展,可以使用命令:
yum install libmcrypt-devel
然后再使用命令:
yum install php-mcrypt
这样就成功安装mcrypt扩展了。
第二步,安装php:
cd /tmp wget http://cn2.php.com/get/php-5.5.10.tar.gz/from/cn2.php.com/mirror tar -zxvf mirror cd ./php-5.5.10
然后执行命令:
./configure \ --prefix=/usr/local/php5 \ --with-config-file-path=/usr/local/php5/etc \ --with-bz2 \ --with-curl \ --enable-ftp \ --enable-sockets \ --disable-ipv6 \ --with-gd \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-freetype-dir=/usr/local \ --enable-gd-native-ttf \ --with-iconv-dir=/usr/local \ --enable-mbstring \ --enable-calendar \ --with-gettext \ --with-libxml-dir=/usr/local \ --with-zlib \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-mysql=mysqlnd \ --enable-dom \ --enable-xml \ --with-libdir=lib64 \ --enable-pdo \ --enable-fpm \ --enable-mcrypt
编译过程有可能报如下错误:
checking for known struct flock definition… configure: error: Don’t know how to define struct flock on this system, set –enable-opcache=no
解决方法是:
yum groupinstall "Development tools"
make make install
以上就介绍了linux源码编译php5.4以上自带php-fpm的configure参数和依赖包,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。