`
日光倾城。
  • 浏览: 83131 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

Call to undefined function image_type_to_extension

    博客分类:
  • php
阅读更多
困扰了我很久的一个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
分享到:
评论
1 楼 柏新星 2012-04-26  
修改 Include/Image.class.php 第34行
我这 是43行

相关推荐

Global site tag (gtag.js) - Google Analytics