赞
踩
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(/usr/local/php为编译后)
执行 ./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
或
extension=/usr/local/php/lib/php/extensions/no-debug-zts-20190902/gd.so
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。