PHP发生Call to undefined function imagecreate()错误的解决办法
2017-05-18 11:06
856 查看
在使用PHP处理一些图像时,有时会出现诸如这样的错误:Call to
undefined function imagecreate(),,导致验证码图片没有加载出来
这是由于没有安装或是没有开启php的gd库导致的问题。
解决办法:首先确保已经安装了php的gd库
如果没有使用:sudo apt-get install php-gd;
1:在phpinfo 中查看Loaded Configuration File 是否存在
于是在APACHE的配置文件httpd.conf中设置
比如: PHPIniDir "/usr/local/php/etc/php.ini"
重启apache。
(注意:确保PHPIniDir在loadModule php5_module之前)
打开php安装目录下的php.ini配置文件,找到这一行:
[plain] view
plain copy
;extension=php_gd2.dll
将这一行前面的;号去掉,然后保存。这样已经开启了gd扩展库。
undefined function imagecreate(),,导致验证码图片没有加载出来
这是由于没有安装或是没有开启php的gd库导致的问题。
解决办法:首先确保已经安装了php的gd库
如果没有使用:sudo apt-get install php-gd;
1:在phpinfo 中查看Loaded Configuration File 是否存在
于是在APACHE的配置文件httpd.conf中设置
比如: PHPIniDir "/usr/local/php/etc/php.ini"
重启apache。
(注意:确保PHPIniDir在loadModule php5_module之前)
打开php安装目录下的php.ini配置文件,找到这一行:
[plain] view
plain copy
;extension=php_gd2.dll
将这一行前面的;号去掉,然后保存。这样已经开启了gd扩展库。
相关文章推荐
- PHP发生Call to undefined function imagecreate()错误的解决办法
- PHP发生Call to undefined function imagecreate()错误的解决办法
- php在iis上配置时报Fatal error: Call to undefined function mysql_connect() in 错误解决办法
- php提示Call to undefined function curl_init() 错误的解决办法
- iis+php+mysql 错误 ---Call to undefined function mysql_connect()的解决办法
- PHP错误:call to undefined function imagecreatetruecolor
- error: Call to undefined function imagecreate()的解决办法
- PHP error: Call to undefined function imagecreate()的解决办法
- Call to undefined function ImageCreate()错误解决 扩展gd库
- php 提示Call to undefined function curl_init() 错误的解决办法
- Call to undefined function imagecreatetruecolor() imageCreate() 的gd库解决办法
- php在iis上配置时报Fatal error: Call to undefined function mysql_connect() in 错误解决办法
- php提示Fatal error: Call to undefined function imagecreate()
- PHP:Call to undefined function curl_init()解决办法
- 配置 -- php运行报Call to undefined function curl_init()的解决办法
- phpmyadmin:Call to undefined function __() Config.class.php on line 755 解决办法
- 关于MAC下php出现:Call to undefined function Think\imagettftext()的解决办法
- phpMyAdmin出现Fatal error: Call to undefined function __() in ..../core.lib.php on line 229解决办法
- php报错-Call to undefined function imagecreatetruecolor() in
- PHP: Call to undefined function imageconvolution() 错误