Tag: Ade code BSP prompts AC str to run BLE generation
In PHP, the Imagecreate function is a graphics processing function, mainly used to create a new color palette-based image, and then on this basis we can be created some graphics numeric characters and the like, but this function requires the GD library support, if you do not open the GD library use will prompt call to Undefined function imagecreate () error.
example, I was testing an instance of a simple build graph
Example #1 Create a new GD image stream and output the image
The code is as follows |
Copy Code |
<?php header ("Content-type:image/png"); $im = @imagecreate (+) or Die ("Cannot Initialize new GD image Stream"); $background _color = imagecolorallocate ($im, 255, 255, 255); $text _color = imagecolorallocate ($im, 233, 14, 91); Imagestring ($im, 1, 5, 5, "A simple Text String", $text _color); Imagepng ($im); Imagedestroy ($im);?> |
Prompt when operating mechanism
Fatal error:call to undefined function imagecreate () .....
The back suddenly remembered that the GD library had not been opened
The problem is: The GD library is not properly installed or configured, the solution:
Found in php.ini; Extension=php_gd2.dll remove the front; Then copy the Php_gd2.dll under ext in the PHP directory into the c:/windows/system32 and c:/windows directories, restart IIS or Apache OK.
GD Library opens in CentOS
There are only 2 commands for the operation: Run the command to install PHP with the GD library online:
The code is as follows |
Copy Code |
Yum-y Install PHP-GD |
Restart the APACHCE service for the post-installation GD library to take effect
The code is as follows |
Copy Code |
/ETC/RC.D/INIT.D/HTTPD Restart (Service httpd restart) |
Installation path of GD
/etc/php.d/gd.ini <---This is to let PHP support GD's Oh, this is one of the features of CentOS, do not have to write everything in php.ini this file, just need to write *.ini file in the/etc/php.d/folder Yes, the system will automatically read the *.ini in this directory into php.ini/usr/lib/php/modules/gd.so <----This is GD's file.
Install the GD library to resolve thinkphp verification code call to undefined function think\imagecreate () error