当前位置:   article > 正文

linux中添加php7中的gd库_php7编译安装gd

php7编译安装gd

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
 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/456270
推荐阅读
相关标签
  

闽ICP备14008679号