在php中imagecreate函数是一个图形处理函数,主要用于新建一个基于调色板的图像了,然后在这个基础上我们可以创建一些图形数字字符之类的,但这个函数需要GD库支持,如果没有开启GD库使用时会提示Call to undefined function imagecreate()错误。
例,我在测试一个简单生成图形时实例
Example #1 新建一个新的 GD 图像流并输出图像
代码如下 | 复制代码 |
<?php |
运行机制时提示
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 <---这个是让php支持gd的哦,这个是CentOS的特色之一,不用把全部东西都写在php.ini这个文件里,只是需要把*.ini文件写在/etc/php.d/文件夹就可以了,系统会自动把这个目录下的*.ini读入php.ini
/usr/lib/php/modules/gd.so <----这个就是gd的文件啦
关于需要使用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
相关推荐
Fatal error: Call to undefined function curl_init()解决方法
php中连接mysql时出现Fatal error Call to undefined function mysql_connect() 解决方法
主要介绍了PHP FATAL ERROR: CALL TO UNDEFINED FUNCTION BCMUL()解决办法,需要的朋友可以参考下
ODBC解决Call to undefined function odbc_connect
Fatal error: Class ‘COM’ not found in XXXXXXXXX 没发现 COM 类,php代码主要是调用一些系统的信息,初想应该是php没配置好,在stackoverflow找到答案,是讨论xampp的,要延伸开来,我加了几个要点: ★ php 根...
在网上下载了一个模拟登陆discuz论坛的php程序范例,试运行时出现“Call to undefined function curl_init”这个错误提示,没有定义的函数,也就是php还没打开对curl_init函数的支持。Google了一番终于解决了,方法...
php也需要配置环境变量 解决Fatal error Call to undefined function curl_init()
fatal error: boostdesc_bgm.i: No such file or directory补充文件
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped g++/gcc都不能编译了,一直抱ld的问题。网上找了很多方法都不行,弄了好久终于搞定了
一、Fatal error: Call to undefined function…… 函数不存在,可能的原因: 1、系统不存在这个函数且你也没自定义 2、有人会问,我在别的机器上就不报错。那是因为环境不同,这个函数在本机没开,怎么开?你百度...
i-Pass Lev CCI_v.1.2 指标。
加载sklearn库有可能遇到Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll 问题,解决卸载掉numpy,scipy,sklearn三个库重新安装,资源的版本为py35,cpu,64位,全程分别为numpy-1.15.4+mkl-cp35-cp35m-win_...
1、在php.ini中开启curl扩展 2、将php目录下的libeay32.dll、ssleay32.dll、php5ts.dll拷贝到c:\windows\system32里面 (还有一种方法是说在httpd.conf中加上动态链接库,如:LoadFile d:/php/libeay32.dll 和 Load...
在提问题前请先仔细查阅PHP手册,MYSQL手册 以及PHPINFO里面的设置 另外希望你读一下PHP编程标准 1:为什么我得不到变量 我在一网页向另一网页POST数据name,为什么输出$name时却得不到任何值? 在PHP4.2...
ueditor1_2_5资源下载,包含Java,.net,php三种语言,gbk,utf-8两种编码总共五个版本,
fatal error: zmq.hpp: No such file or directory compilation terminated. 找不到zmq.hpp的原因是, zmq.hpp只存在master中。 如果你使用release版本,那么是没有zmq.hpp这个文件的。去master中找到zmq.hpp。 将...
fatal error: pcre2.h: No such file or directory 27 | #include "pcre2.h" 安装swoole遇到错误,把pcre2.h 放到、usr/include下
linux课件附习题讲解、复习题及模拟试题