linux下安装 ftp拓展 gd拓展 redis拓展 swoole拓展

 

 

 ftp拓展

cd /usr/local/src/php-7.0.32/ext/ftp

#进入PHP安装源码包,找到ext下的ftp,进入  find -name ftp

/usr/local/php/bin/phpize 
#whereis phpize 得到路径 或者 find / -name phpize 得到路径

./configure --with-php-config=/usr/local/php/bin/php-config 
#whereis php-config查看路径 或者 find / -name php-config 得到路径


make && make install

 

 

gd拓展

1:安装gd的依赖包 

yum -y install gd gd2 gd-devel gd2-devel zlib freetype

 安装jpeg:

  wget  http://www.ijg.org/files/jpegsrc.v9b.tar.gz

  tar -xvf jpegsrc.v9b.tar.gz

#进入jpeg-9b

 ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static

make && make install

2.安装gd

cd  /usr/local/src/php-7.0.32/ext/gd

#进入PHP安装源码包,找到ext下的ftp,进入  find -name gd

/usr/local/php/bin/phpize

#whereis phpize 得到路径 或者 find / -name phpize 得到路径

 ./configure --with-php-config=/usr/local/php/bin/php-config -with-png-dir --with-freetype-dir --with-jpeg-dir=/usr/local/jpeg -with-zlib-dir --with-gd make install

 

 

redis拓展

git clone https://github.com/nicolasff/phpredis
#进入 phpreids目录中去

/usr/local/php/bin/phpize
#whereis phpize 得到路径 或者 find / -name phpize 得到路径

./configure --with-php-config=/usr/local/php/bin/php-config
#whereis php-config查看路径 或者 find / -name php-config 得到路径

make && make install

 

 

swoole拓展

wget -c https://github.com/swoole/swoole-src/archive/v2.0.6.tar.gz

解压: tar -zxvf v2.0.6.tar.gz

#进入swoole-src-2.0.6目录中去

/usr/local/php/bin/phpize 
#whereis phpize 得到路径 或者 find / -name phpize 得到路径

./configure --with-php-config=/usr/local/php/bin/php-config 
#whereis php-config查看路径 或者 find / -name php-config 得到路径

make && make install

/usr/local/php/bin/php -m

#查看是否安装成功:

/usr/local/php/lib/php/extensions/no-debug-zts-20151012/

#编译成功查看拓展存放位置

php.ini中增加

extension=redis.so
extension=swoole.so
extension=ftp.so
extension=gd.so

systemctl restart httpd

#重启apache

原文地址:https://www.cnblogs.com/mengor/p/7487805.html