dttwois6098 2011-06-03 10:07
浏览 34
已采纳

为什么codeigniter会给我这个错误?

I'm trying to make thumbmails of user imaes. However, I always get 'path to the image is incorrect."

my code:

$settings = array(
            'source_image' => '/videotuts/profilepic/userimg.png',
            'create_thumb' => TRUE,
            'new_image' => '/videotuts/profilepic'
        );
$this->load->library('image_lib',$settings);

$r = $this->image_lib->resize();

Does it matter that codeigniter is not installed in my website root?

  • 写回答

3条回答 默认 最新

  • dongying9712 2011-06-03 14:21
    关注

    Looking at all the answers and comments, let me assume that you have codeigniter in folder /htdocs/videotuts/, notice there is a / in the starting. So you index.php is located in htdocs/videotuts/index.php. Codeigniter libraries will follow any path respective to index.php and hence there should be a path /videotuts/profilepic/userimg.png under /htdocs/videotuts/or the full path should be '/htdocs/videotuts/videotuts/profilepic/userimg.png'. If its not the same, remove the unwanted folder name from your paths. You don't need to use APPPATH or FCPATH or BASEPATH. 2ndly, if you are creating thumbnails, I hope you have correctly set read write perms for image folders.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 vc6.0中想运行代码的时候总是提示无法打开文件是怎么回事
  • ¥25 关于##爬虫##的问题,如何解决?:
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题