drbz99867 2015-12-10 06:51
浏览 78

phpThumb既不显示缩略图也不显示错误消息?

I',m running a PHP website on nginx and use phpthumb to generate thumbnail images. This web site is exposed via amazon-cloud front.

The issue here is that the phpthumb does not return the thumbnail image, instead it returns the default (no_image.png) error image (couldn't find any meaningful errors in the logs as well).

Please tell me if it is required to have any special configuration in phpThumb when connecting via a cdn such as cloudfront

Is there any specific way to run the phpthumb in the debug mode so that I can see the full error message causing the problem?

----------Given below is the trace of cloud front log--------

2015-12-10  05:51:10    SIN2    1116    112.135.54.88   GET d3aaaaaav9caaap.cloudfront.net  /includes/phpthumb/no_image.png 200 https://mywebsite.com/product.php?id=63 Mozilla/5.0%2520(Windows%2520NT%25206.1;%2520WOW64;%2520rv:42.0)%2520Gecko/20100101%2520Firefox/42.0    -   -   Miss    G2o7oqMRRa89J6Z-mdnizSx9GwBbV6PqJSl1IuhMGoZ-2nj5rJbWIw==    mywebsite.com   https   736 0.178   -   TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 Miss

2015-12-10  05:51:10    SIN2    1354    112.135.54.88   GET d3aaaaaav9caaap.cloudfront.net  /images/trans_white_60.png  200 https://mywebsite.com/css/styles.css    Mozilla/5.0%2520(Windows%2520NT%25206.1;%2520WOW64;%2520rv:42.0)%2520Gecko/20100101%2520Firefox/42.0    -   -   Miss    zrJvbg9LKZ3SJMA32vrXrn12mJKbaytLBgVOH0fDvpmIGlwp_x1PfA==    mywebsite.com   https   720 0.178   -   TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 Miss

2015-12-10  05:51:08    SIN2    95281   112.135.54.88   GET d3aaaaaav9caaap.cloudfront.net  /scripts/jquery.js  200 https://mywebsite.com/product.php?id=63 Mozilla/5.0%2520(Windows%2520NT%25206.1;%2520WOW64;%2520rv:42.0)%2520Gecko/20100101%2520Firefox/42.0    -   -   Miss    lBuPYl9KPv138__Ll455aXlX6vjd4eOtVXrkm8jahqWWfPle_ahT1Q==    mywebsite.com   https   687 1.519   -   TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 Miss

2015-12-10  05:51:10    SIN2    416 112.135.54.88   GET d3aaaaaav9caaap.cloudfront.net  /includes/phpthumb/phpthumb.php 302 https://mywebsite.com/product.php?id=63 Mozilla/5.0%2520(Windows%2520NT%25206.1;%2520WOW64;%2520rv:42.0)%2520Gecko/20100101%2520Firefox/42.0    src=images/products/mw-rt300(2).png&w=215&h=215&zc=1    -   Miss    g6665DnogX53Gm0-ZyOxrxKSO023HXz4MAnr_k5v9kJo6GtFB8O6qg==    mywebsite.com   https   700 0.190   -   TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 Miss
  • 写回答

1条回答 默认 最新

  • donglu1973 2015-12-10 10:55
    关注

    After spending hours on this I've just managed to find the issue. issue was clearly with the path to the image. (I know it's stupid)

    <img src="includes/phpthumb/phpthumb.php?src=images/products/myimage.png&amp;w=215&amp;h=215&amp;zc=1">
    

    I just had to append the "../../" to the path of the image as given below and it solved the problem.

    <img src="includes/phpthumb/phpthumb.php?src=../../images/products/myimage.png&amp;w=215&amp;h=215&amp;zc=1">
    

    This could have been much easier if there is a proper error message shown by phpThumb.

    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试