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 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大