困扰了我很久的一个thinkphp问题,本地可以上传,但是服务器却无法上传图片,找了半天,问服务器商,他说不是自己的问题,只好自己看看问题所在,原来有些服务器上的php版本不够高,貌似这个函数要php5.X的5.0以上的版本。
在网上找了半天,找到了thinkphp官方论坛,找到了这篇文章:
http://bbs.thinkphp.cn/viewthread.php?tid=14195&highlight=Call%2Bto%2Bundefined%2Bfunction%2Bimage/_type/_to
好了,说说修改问题的方法吧:
修改 Include/Image.class.php 第34行
把这一行
$imageType = strtolower(substr(image_type_to_extension($imageInfo[2]),1));
替换为
if(function_exists(image_type_to_extension)){
$imageType = strtolower(substr(image_type_to_extension($imageInfo[2]),1));
}else{
$imageType = strtolower(substr($img,strrpos($img,'.')+1));
}
源网址:
http://www.yueyuaner.com/?p=23
分享到:
相关推荐
ODBC解决Call to undefined function odbc_connect
复制 php_sockets.dll 到ext目录 修改php.ini: extension=php_sockets.dll php4ts.dll php5ts.dll php_mime_magic.dll复制到C:\winnt\system32文件夹。 服务器
php中连接mysql时出现Fatal error Call to undefined function mysql_connect() 解决方法
php也需要配置环境变量 解决Fatal error Call to undefined function curl_init()
在网上下载了一个模拟登陆discuz论坛的php程序范例,试运行时出现...这样的语句,出现Call to undefined function curl_init()的错误提示。 解决方法如下: 1、在php.ini中找到extension=php_curl.dll,去掉前面的,ph
Fatal error: Call to undefined function curl_init()解决方法
之前网上的解决方法如下: ...3、重启apache,OK! 不知道这些人是不是真的试过而且成功了,就把这些所谓的解决方案往网上分享。到最后我们这些新来者,百度到的所有解决方案,到最后都只剩一种,而且还是找不到源头
thinkphp5图片组件解决captcha_src()/captcha_img() 已经生成好 直接解压到vendor目录即可 快速解决壁盯墙
主要介绍了PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 如何解决的相关资料,需要的朋友可以参考下
主要介绍了ThinkPHP做文字水印时提示call an undefined function exif_imagetype()解决方法,是项目开发中非常实用的技巧,需要的朋友可以参考下
1、php.ini的extension_dir值是哪个目录, 2、在那个目录下检查有无php_curl.dll,没有的话请下载php_curl.dll, 3、再把php目录中的libeay32.dll和ssleay32.dll拷到c:\windows\system32里面, 4、重启apache,OK!
声明:我使用的是php5.5查看你的php版本的方法是输入:php -v如果显示:The program 'php5' is currently not ins
在很多php教程初学者都会在初次php mysql时出来undefined function mysql_connect() 错误提示,下面我们来分析原因中。
主要介绍了PHP FATAL ERROR: CALL TO UNDEFINED FUNCTION BCMUL()解决办法,需要的朋友可以参考下
i-Pass Lev CCI_v.1.2 指标。