php7安装gd库,解决tp5tp6验证码模块出现未定义imagettftext()的问题

1.把phpize加到系统全局中,方便使用:# ln -s /usr/local/php/bin/phpize /bin/

2.先安装freetype 下载: # wget "http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2"

3: 解压: # tar jxvf freetype-2.4.0.tar.bz2

4.进入# cd reetype-2.4.0

5.执行# ./configure --prefix=/usr/local/freetype && make && make install

6.进入之前解压的php文件夹里面 /***/ext/gd 里面运行 phpize 然后:make clean

7.运行 # ./configure --with-freetype-dir=/usr/local/freetype --with-php-config=/usr/local/php/bin/php-config 然后 # make && make install

8.php.ini添加一行 extension=gd

9.执行killall php-fpm 然后执行 .php-fpm 再执行php -m查看gd库是否开启

猜你喜欢

转载自blog.51cto.com/qq512430/2506002
今日推荐