PHP compiled GD support Verification code login

Source: Internet
Author: User

The problem is that the script-compiled PHP does not support GD, and cannot generate dynamic verification codes?



The Final Solution is:


1. Make sure the Gd,jpeg,png,freetype package is installed (based on centos6.7 yum installation)


[Email protected] 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


[Email protected] 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


[Email protected] nginx+php1.9]# Rpm-qa | grep FreeType

Freetype-devel-2.3.11-17.el6.x86_64

Freetype-2.3.11-17.el6.x86_64


[Email protected] 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. Compile and install, pay attention to the red font

./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 See results

Gd
GD Support Enabled
GD Version Bundled (2.1.0 compatible)
FreeType Support Enabled
FreeType Linkage With FreeType
FreeType Version 2.5.0
GIF Read Support Enabled
GIF Create Support Enabled
JPEG Support Enabled
Libjpeg Version 6b
PNG Support Enabled
LibPNG Version 1.2.49
WBMP Support Enabled
XBM Support Enabled


The PHP page generating the dynamic code is displayed normally

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/89/ED/wKioL1gh122T5qXsAAB5oDFFm_0161.png-wh_500x0-wm_3 -wmp_4-s_1485932862.png "title=" Bda66edf-dd48-4956-9dc6-15c3bcabb28c.png "alt=" wkiol1gh122t5qxsaab5odffm_0161. Png-wh_50 "/>

This article comes from "Plum blossom fragrance from bitter cold!" "Blog, be sure to keep this provenance http://daixuan.blog.51cto.com/5426657/1870824

PHP compiled GD support Verification code login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.