每个人。
我正在使用调整 JPG 图像大小的图像调整器脚本。它在我的远程服务器上运行良好,但不幸的是它在客户端的服务器上不起作用。:-|
目录是可写的(权限设置为 777)。我得到的是:
Error: image does not exist: /home/content/u/s/e/username/correct/path/to/existing/file.jpg
以下是可能有助于调试的代码:
// Images must be local files, so for convenience we strip the domain if it's there
$image = preg_replace('/^(s?f|ht)tps?:\/\/[^\/]+/i', '', (string) $_GET['image']);
// ...
// Strip the possible trailing slash off the document root
$docRoot = preg_replace('/\/$/', '', DOCUMENT_ROOT);
//...
if (!file_exists($docRoot . $image))
{
header('HTTP/1.1 404 Not Found');
echo 'Error: image does not exist: ' . $docRoot . $image;
exit();
}
请注意,作为开发人员,我已获得访问根目录子目录的权限。
我希望我能清楚地说明问题。我不知道幕后发生了什么。非常感谢帮助