php编译gd支持验证码登陆

问题是脚本编译的php不支持gd,不能生成动态的验证码?

成都创新互联专业提供成都主机托管四川主机托管成都服务器托管四川服务器托管,支持按月付款!我们的承诺:贵族品质、平民价格,机房位于中国电信/网通/移动机房,移动服务器托管服务有保障!

最终的解决办法是:

1.确定gd,jpeg,png,freetype包都已经安装(基于centos6.7 yum安装)

[root@mcd nginx+php1.9]# rpm -qa | grep jpe

libjpeg-turbo-1.2.1-3.el6_5.x86_64

libjpeg-turbo-1.2.1-1.el6.x86_64

openjpeg-libs-1.3-11.el6.x86_64

libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64

[root@mcd nginx+php1.9]# rpm -qa | grep png

libpng-1.2.49-2.el6_7.x86_64

libpng-devel-1.2.49-2.el6_7.x86_64

libpng-1.2.49-1.el6_2.x86_64

[root@mcd nginx+php1.9]# rpm -qa | grep freetype

freetype-devel-2.3.11-17.el6.x86_64

freetype-2.3.11-17.el6.x86_64

[root@mcd nginx+php1.9]# rpm -qa | grep gd

gdb-gdbserver-7.2-60.el6.x86_64

gdbm-1.8.0-38.el6.x86_64

eggdbus-0.6-3.el6.x86_64

gdm-plugin-smartcard-2.30.4-39.el6.x86_64

gd-devel-2.0.35-11.el6.x86_64

gd-2.0.35-11.el6.x86_64

gdm-2.30.4-39.el6.x86_64

gdb-7.2-60.el6.x86_64

gdm-libs-2.30.4-39.el6.x86_64

gdk-pixbuf2-2.24.1-6.el6_7.x86_64

gdb-7.2-83.el6.x86_64

gdbm-devel-1.8.0-38.el6.x86_64

gdm-plugin-fingerprint-2.30.4-39.el6.x86_64

gdbm-1.8.0-36.el6.x86_64

gdb-gdbserver-7.2-83.el6.x86_64

gdm-user-switch-applet-2.30.4-39.el6.x86_64

gdb-7.2-90.el6.x86_64

php-gd-5.3.3-48.el6_8.x86_64

gdk-pixbuf2-devel-2.24.1-6.el6_7.x86_64

2.编译安装,注意标红的字体

./configure --prefix=/opt/php --with-config-file-path=/opt/php/etc/php5 --with-MySQL=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-zlib --with-libxml-dir --enable-xml --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-ftp --with-gd--with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-mime-magic --with-freetype-dir --with-jpeg-dir --with-png-dir 

make

make install

3.phpinfo看到结果

gd

GD Supportenabled
GD Versionbundled (2.1.0 compatible)
FreeType Supportenabled
FreeType Linkagewith freetype
FreeType Version2.5.0
GIF Read Supportenabled
GIF Create Supportenabled
JPEG Supportenabled
libJPEG Version6b
PNG Supportenabled
libPNG Version1.2.49
WBMP Supportenabled
XBM Supportenabled

生成动态码的php页面正常显示

php编译gd支持验证码登陆

网站题目:php编译gd支持验证码登陆
分享URL:https://www.cdcxhl.com/article16/pgppdg.html

成都网站建设公司_创新互联,为您提供做网站ChatGPT企业建站App设计App开发面包屑导航

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都seo排名网站优化