php提示Fatal error: Call to undefined function imagecreate()
在php中imagecreate函数是一个图形处理函数,主要用于新建一个基于调色板的图像了,然后在这个基础上我们可以创建一些图形数字字符之类的,但这个函数需要GD库支持,如果没有开启GD库使用时会
//
undefined
例,我在测试一个简单生成图形时实例
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
//
undefined
http://www.android100.org/html/201407/11/38612.html
php提示Fatal error: Call to undefined function imagecreate()的更多相关文章
- fatal error: Call to undefined function mysqli_connect()
在搭建PHP5.6+APACHE2.4+MYSQL5的平台时,测试是否成功连接mysql, 测试程序index.php <?php phpinfo() ?> 没有出现mysql的信息 所以 ...
- "Fatal error: Call to undefined function: file_put_contents()"
打开页面时提示这个错误: Fatal error: Call to undefined function: file_put_contents() 意思是请求未定义的函数,出现这个提示通常有两种情况: ...
- PHP Fatal error: Call to undefined function mysql_connect() 错误解释
我使用的是5.6.11版本的php 刚开始以为编译参数加了--with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd,就可以不能安装mysql了. 但是使用了mysq ...
- linux又一次编译安装gd,添加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()
问题: Fatal error: Call to undefined function Think\imagettftext() in /var/www/webreg/ThinkPHP/Library ...
- Fatal error: Call to undefined function imagettftext()解决办法
Fatal error: Call to undefined function imagettftext()解决办法 我的问题是php编译安装时指定了gd的目录,其实不用指定.就可以了 博客分类: ...
- Fatal error: Call to undefined function mysql_connect()
我在进行PHP环境搭建:Windows 7下安装配置PHP+Mysql+apache环境时,之前都没有什么问题,只是在验证PHP是否能连接Mysql时出现如下错误:Fatal error: Call ...
- Fatal error: Call to undefined function json_decode()解决办法
最近搭建测试服务器,访问网站查看报错日志出现如下错误: Fatal error: Call to undefined function json_decode() 出现该问题原因是安装PHP时没有安装 ...
- Fatal error: Call to undefined function mb_strlen()
php配置的时候出现:Fatal error: Call to undefined function mb_strlen() 表示php不能加载mbstring模块,在php 的配置文件php.in ...
- 又一个错误" Fatal error: Call to undefined function myabp_print_screenshot_all() "
xxx ( ! ) Fatal error: Call to undefined function myabp_print_screenshot_all() in D:\wamp\www\wp-con ...
随机推荐
- 加载xib文件
// Test.xib --编译--> Test.nib // 方式1 NSArray *objs = [[NSBundle mainBundle] loadNibNamed:@"Te ...
- NoSQL数据库的分布式模型
NoSQL数据库的分布式模型 单一服务器 在一个服务器完全能够胜任工作时就没必要考虑分布式,这样部署简单,维护也方便很多: 分片 特点 数据的各个部分存放在集群的不同服务器中: 比如按字母来划分:以a ...
- SQL - 批量修改表中所有行数据某字段的部分内容
UPDATE 表名 SET 字段名 = REPLACE (字段名, 'old', 'new');
- NS3 日志(Logging)、命令行参数、Tracing系统概述(转载)
NS-3日志子系统的提供了各种查看仿真结果的渠道: 一.使用Logging Module 1 [预备知识]日志级别及其对应的宏 NS-3 提供了若干个日志级别来满足不同的 Debug 需求,每一级的日 ...
- Lodop在搜狗兼容模式下打印无边框问题
项目中原有的CAP方式打印由于只支持IE浏览器,由于目前大家使用IE的频率越来越少,迫切需要一个控件来替换项目原有的控件,比较了下选择Lodop,购买了一个最便宜的版本,使用后,有用户使用搜狗的兼容模 ...
- html,CSS文字大小单位px、em、pt的关系换算
html,CSS文字大小单位px.em.pt的关系换算 这里引用的是Jorux的“95%的中国网站需要重写CSS”的文章,题目有点吓人,但是确实是现在国内网页制作方面的一些缺陷.我一直也搞不清楚px与 ...
- NullPointerException异常的原因??
所谓空指针异常,是因为用空(null)去调用属性或方法. null表示没有这个对象,既然没有这个对象,那么去调用他的属性和方法,就会报异常. <--主要有以下几种原因: 1.使用了未 ...
- iOS开发之Xcode6 之手动添加Pch预编译文件
参考文档 http://blog.csdn.net/crazyzhang1990/article/details/44243343 红色部分为本人自己补充注意事项 在Xcode6之前,创建一个新工程x ...
- gradle资料
<Gradle用户教程>中文版 · GitBookhttps://www.gitbook.com/book/yeetrack/-gradle-user-guide-chinese/deta ...
- Css_Backgroud-position(背景图片)定位问题详解
background-position的说明: 设置或检索对象的背景图像位置.必须先指定 background-image 属性.该属性定位不受对象的补丁属性( padding )设置影响. ...