全部以源码编译方式为例,在centos7上操作

1、下载
https://www.php.net/distributions/php-7.4.9.tar.gz

2、准备(应该有多余的库
yum -y install patch gd-devel libxml2-devel libmcrypt-devel openldap-devel mhash-devel curl-devel libpng-devel libjpeg-devel freetype-devel sqlite-devel oniguruma-devel zlib-devel

3、编译安装php
cd /xxx/php-7.4.9/
./configure
--prefix=/usr/local/php
--enable-fpm
--enable-gd
--with-freetype
--with-jpeg
--with-iconv
--with-zlib
--enable-xml
--disable-rpath
--enable-bcmath
--enable-shmop
--enable-sysvsem
--enable-inline-optimization
--with-curl
--enable-mbregex
--enable-mbstring
--with-openssl
--with-mhash
--enable-pcntl
--enable-sockets
--with-xmlrpc
--enable-soap  
--without-pear
--enable-ftp

make
make install
cp php.ini-production /usr/local/php/lib/php.ini

4、编译安装gd
cd /xxx/php-7.4.9/ext/gd
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-freetype --with-jpeg --enable-gd
make
make install

5、配置php.ini
/usr/local/php/lib/php.ini中添加
extension=gd

标签: , ,
发表评论   请注意:本站已经启用评论审核机制,审核通过才能显示!
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称 *   
网址   电邮   [注册]
               

验证码 不区分大小写