困扰了我很久的一个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));
}
源网址:[url]http://www.yueyuaner.com/?p=23[/url]
在网上找了半天,找到了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));
}
源网址:[url]http://www.yueyuaner.com/?p=23[/url]