php提示Fatal error: Call to undefined function imagecreate()_PHP教程
例,我在测试一个简单生成图形时实例
Example #1 新建一个新的 GD 图像流并输出图像
代码如下 | 复制代码 |
header("Content-type: image/png"); |
运行机制时提示
Fatal error: Call to undefined function imagecreate() .....
后面突然想起没打开gd库了
这一问题是:GD库没有正确安装或配置,解决方案:
在php.ini中找到
;extension=php_gd2.dll
去掉前边的;
然后将php目录中的ext下的php_gd2.dll拷入c:/windows/system32和c:/windows目录下,重启IIS或者apache就OK了.
centos中gd库开启
具体操作只有2个命令如下:
运行在线安装带GD库的PHP的命令:
代码如下 | 复制代码 |
yum -y install php-gd |
重新启动apachce服务以使安装后的GD库生效
代码如下 | 复制代码 |
/etc/rc.d/init.d/httpd restart(service httpd restart) |
gd的安装路径
/etc/php.d/gd.ini /usr/lib/php/modules/gd.so
关于需要使用GD库的图形处理函数还有如下
gd_info
getimagesize
getimagesizefromstring
image_type_to_extension
image_type_to_mime_type
image2wbmp
imageaffine
imageaffinematrixconcat
imageaffinematrixget
imagealphablending
imageantialias
imagearc
imagechar
imagecharup
imagecolorallocate
imagecolorallocatealpha
imagecolorat
imagecolorclosest
imagecolorclosestalpha
imagecolorclosesthwb
imagecolordeallocate
imagecolorexact
imagecolorexactalpha
imagecolormatch
imagecolorresolve
imagecolorresolvealpha
imagecolorset
imagecolorsforindex
imagecolorstotal
imagecolortransparent
imageconvolution
imagecopy
imagecopymerge
imagecopymergegray
imagecopyresampled
imagecopyresized
» imagecreate
imagecreatefromgd2
imagecreatefromgd2part
imagecreatefromgd
imagecreatefromgif
imagecreatefromjpeg
imagecreatefrompng
imagecreatefromstring
imagecreatefromwbmp
imagecreatefromwebp
imagecreatefromxbm
imagecreatefromxpm
imagecreatetruecolor
imagecrop
imagecropauto
imagedashedline
imagedestroy
imageellipse
imagefill
imagefilledarc
imagefilledellipse
imagefilledpolygon
imagefilledrectangle
imagefilltoborder
imagefilter
imageflip
imagefontheight
imagefontwidth
imageftbbox
imagefttext
imagegammacorrect
imagegd2
imagegd
imagegif
imagegrabscreen
imagegrabwindow
imageinterlace
imageistruecolor
imagejpeg
imagelayereffect
imageline
imageloadfont
imagepalettecopy
imagepalettetotruecolor
imagepng
imagepolygon
imagepsbbox
imagepsencodefont
imagepsextendfont
imagepsfreefont
imagepsloadfont
imagepsslantfont
imagepstext
imagerectangle
imagerotate
imagesavealpha
imagescale
imagesetbrush
imagesetinterpolation
imagesetpixel
imagesetstyle
imagesetthickness
imagesettile
imagestring
imagestringup
imagesx
imagesy
imagetruecolortopalette
imagettfbbox
imagettftext
imagetypes
imagewbmp
imagewebp
imagexbm
iptcembed
iptcparse
jpeg2wbmp
png2wbmp
推荐阅读
-
Uncaught Error: Call to undefined function imageCreateTruecolor() in ,php7中GD库打不开
-
PHP FATAL ERROR: CALL TO UNDEFINED FUNCTION BCMUL()解决办法
-
php用mysqli模块连数据库Fatal error: Call to a member function query() 。解决思路
-
php连接mysql出错:Fatal error: Call to undefined function mysql_connect(),该如何处理
-
php遇到错误Call to undefined function ImageCreate()解决方法
-
php5.3提示Function ereg() is deprecated Error问题解决方法,eregdeprecated_PHP教程
-
Call to undefined function curl_init(),undefinedcurl_init_PHP教程
-
错误提示:Fatal error: Call to undefined function mysqli_num_row()
-
php运行网站内存不足提示 Fatal error Allowed memory size_PHP教程
-
php提示:Call to undefined function curl_init