简体   繁体   English

为什么 TimThumb 不显示此图像?

[英]Why isn't this image being displayed with TimThumb?

I am using TimThumb at http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/ .我在http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/使用 TimThumb。

I have adjusted the memory_limit to "5000MB" in my php.ini file and in the TimThumb code I adjusted the code to the following:我在我的 php.ini 文件和 TimThumb 代码中将 memory_limit 调整为“5000MB”,我将代码调整为以下内容:

    define ('MEMORY_LIMIT', '30M');             // set PHP memory limit
define ('MAX_FILE_SIZE', 7000000000);           // file size limit to prevent possible DOS attacks (roughly 1.5 megabytes)

The picture itself is only 2.23 MB, the last time I checked that wasn't that big lol.图片本身只有 2.23 MB,我上次检查时并没有那么大,哈哈。

You need to use ini_set(), not a define() to change php settings:您需要使用 ini_set(),而不是 define() 来更改 php 设置:

ini_set('memory_limit','64M');

edit: noticed the memory it reports is 30M, so maybe the thumbnail script uses the defined value.编辑:注意到它报告的 memory 是 30M,所以缩略图脚本可能使用定义的值。 Either way, just increase your memory limit until it works.无论哪种方式,只需增加您的 memory 限制,直到它起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM