【发布时间】:2014-05-01 23:09:38
【问题描述】:
我在共享服务器上托管了一个新网站(因此没有 apache 错误日志访问)。一切正常,除了来自 timthumb 的图像。错误可能在 .htaccess 文件中,它在我的本地环境中正常工作。我在本地有 PHP 5.3 版本,而服务器有 5.4 下面是我的 .htaccess 文件的代码
# deny *everything*
<FilesMatch ".*">
#Order Allow,Deny
#Deny from all
</FilesMatch>
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(js|JS|css|CSS|jpg|JPG|gif|GIF|png|PNG|swf|SWF|php)$">
Order Allow,Deny
Allow from all
</FilesMatch>
IndexIgnore */*
OPTIONS -Indexes -ExecCGI
【问题讨论】:
-
在 TimThumb 脚本上设置了哪些 CHMOD 权限?它需要缓存目录的执行和写入权限,因此 chmod timbthumb.php 到 644 和缓存目录到 755 或 777 如果失败。
-
@i-CONICA chmod 权限是 0644 并且错误必须与 .htaccess 有关,因为我刚刚重命名了 .htaccess 并发现图像开始出现
-
哦,我不认为您的文件匹配模式正确匹配文件。试试
-
可能也想注释掉 IndexIgnore /。
-
抱歉,这两种方法都不适合我
标签: php apache .htaccess timthumb