编译安装php-7.1.17及部分扩展

本文详细记录了 PHP 7.1.17 的安装过程及多个扩展模块的配置步骤,包括 GD 图像处理、MySQL 数据库连接、FPM 进程管理、ODBC 数据源配置等,同时还介绍了 Gearman、Redis、MongoDB 等常用组件的集成方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

./configure --prefix=/usr/local/php-7.1.17 --disable-debug --enable-shmop --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 
--with-libxml-dir=/usr/lib64 --with-zlib-dir=/usr/lib64 --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --enable-sockets 
--enable-mbstring --enable-mbregex --enable-ftp --enable-gd-native-ttf --enable-fpm  --enable-pcntl --enable-sysvmsg --enable-sysvsem  --enable-sysvshm  
--enable-zip  --with-curl=/usr/local/curl --with-iconv=/usr/local/libiconv --with-freetype-dir=/usr/local/freetype
Install php-7.1.17/ext/pdo_dblib
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config --with-pdo-dblib=/usr/local/freetds
wget http://www.unixodbc.org/unixODBC-2.3.4.tar.gz
tar zxvf unixODBC-2.3.4.tar.gz
./configure --prefix=/usr/local/unixODBC-2.3.4 --enable-threads --enable-drivers --enable-driver-conf --enable-gui=no --enable-ltdl-install
ln -s /usr/local/unixODBC-2.3.4 /usr/local/unixODBC
Install php-7.1.17/ext/pdo_odbc
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config --with-pdo-odbc=unixODBC,/usr/local/unixODBC
Install php-7.1.17.17/ext/exif
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install php-7.1.17.17/ext/gettext
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install php-7.1.17.17/ext/bcmath
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install php-7.1.17.17/ext/ldap
cp -frp /usr/lib64/libldap* /usr/lib/
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install php-7.1.17.17/ext/soap
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install php-7.1.17.17/ext/openssl
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install mongodb-1.4.3
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
yum install boost boost-devel gperf libuuid-devel libuuid
Install gearmand-1.1.14
./configure  
make && make install
Install gearman-1.1.2
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config 
cp php_gearman.loT php_gearman.lo
make && make install
Install phpunit-5.7.4
mv phpunit /usr/local/bin/phpunit
Install zookeeper-0.4.0
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config --with-libzookeeper-dir=/usr/local/zookeeper
Install imagick-3.4.3
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config --with-imagick=/usr/local/ImageMagick
Install redis-4.0.1
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install mcrypt-1.0.1
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install xdebug-2.7.0alpha1
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install gmagick-2.0.5RC1
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config --with-gmagick=/usr/local/GraphicsMagick
Install pecl-memcache-NON_BLOCKING_IO_php7
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install memcached-3.0.4
https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
./configure --prefix=/usr/local/libmemcached-1.0.18
make && make install
 memcached-3.0.4
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
Install phpng-xhprof-master
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install apcu-5.1.11
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
Install yaf-3.0.7
./configure --with-php-config=/usr/local/php-7.1.17/bin/php-config
  
  

 php.ini新增

extension=apcu.so
;extension=ipquery.so
extension=mcrypt.so
extension=bcmath.so
extension=redis.so
extension=memcache.so
extension=memcached.so
;extension=apc.so
extension=openssl.so
;extension=dba.so
;extension=mongo.so
;extension=memcached.so
;extension=phpwkhtmltox.so
extension=pdo_sqlsrv.so
extension=sqlsrv.so

  

转载于:https://www.cnblogs.com/xzlive/p/9050317.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值