我在我的Web服务器上(使用DirectAdmin)安装了MediaWiki,但我无法启用上传图片(例如 .jpg 格式)的功能。
我已经在设置中将 $wgEnableUploads = true;
,并检查了 images
文件夹是可写的(权限为755)。但是当我尝试上传一个名为 testimage.jpg
的测试图片时,出现以下错误:
Could not store file "/tmp/phpjNV3oh" at "mwstore://local-backend/local-public/1/13/testimage.jpg".
由于我使用的是共享网络托管,只能访问直接管理界面,无法设置图像文件夹的所有者(这里有一个答案)。我已经尝试将文件夹设置为777,但仍然没有改变。
有人知道问题出在哪里吗?可能是因为我使用了Cloudflare吗?此外,为什么错误返回的URL(mwstore://local-backend/local-public/1/13/testimage.jpg"
)不是普通的URL(如mysite.com/wiki/images
或其他类似的URL)?
images/temp/d/d2
目录。但是当我尝试直接在浏览器中访问图片时,会得到一个403错误。所以很可能是mediawiki无法访问images/temp/d/d2
文件夹,就像我一样。问题是,我如何告诉apache不要阻止任何访问?我能否在父目录中放置一个httpd.conf,并使用此处建议的设置:https://dev59.com/weo6XIcBkEYKwwoYQiK7? - user1694077[Sun Jun 08 23:20:46.420476 2014] [:error] [pid 6199] [client example.com:23278] PHP警告:在/home/username/domains/example.com/public_html/wiki/includes/filebackend/FSFileBackend.php的702行,由于安全原因已禁用popen()函数,参考者:http://www.example.com/wiki/index.php?title=Special:Upload&wpDestFile=testimage.jpg&wpForReUpload=1
- user1694077[Sun Jun 08 23:16:22.684117 2014] [:error] [pid 6196] [client example.com:39879] PHP Warning: cp '/tmp/phplnL46o' '/home/username/domains/example.com/public_html/wiki/images/1/13/testimage.jpg'\n in /home/username/domains/example.com/public_html/wiki/includes/filebackend/FSFileBackend.php on line 282, referer: http://www.example.com/wiki/Special:Upload
。 - user1694077