Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
访问本地主机上文件的权限被拒绝(wordpress安装)_Wordpress_Localhost - Fatal编程技术网

访问本地主机上文件的权限被拒绝(wordpress安装)

访问本地主机上文件的权限被拒绝(wordpress安装),wordpress,localhost,Wordpress,Localhost,我有一个奇怪的问题。。。我已经在本地安装了Wordpress(我在Ubuntu上),现在在访问图像文件时遇到了问题。。。在css中,我有: .sprites{ background:url("sprites.png") top left no-repeat; } ._r3_c5{ width:210px; height:204px; background-position:-10px -10px; } 当我尝试这样做时: <div class="sprites _r3_c5"> &

我有一个奇怪的问题。。。我已经在本地安装了Wordpress(我在Ubuntu上),现在在访问图像文件时遇到了问题。。。在css中,我有:

.sprites{ background:url("sprites.png") top left no-repeat; }
._r3_c5{ width:210px; height:204px; background-position:-10px -10px; }
当我尝试这样做时:

<div class="sprites _r3_c5">
</div>

有人知道原因吗?

听起来像是Apache在网站上使用的Ubuntu帐户的权限问题(这通常与您的用户帐户不同)。检查文件/文件夹的所有者、组和权限,并根据需要进行调整


这是WordPress codex中关于安全性的链接

这似乎是目录权限问题,因为您正在尝试使用http获取文件


将目录权限设置为755或777怎么样?

是的,最后我将其设置为777,它工作了。。。我仍然不明白为什么我可以访问该文件夹中的其他文件,如css和php,并且不能访问image.777-每个人都可以读/写/执行。所以,基本上,您正在尝试访问前端上需要读取访问权限的图像文件。其他php和css文件由服务器执行,因此它们不需要777权限。还有另一种可能性,比如,如果您使用相对url访问静态文件。你可以随时尝试可能重复的
Forbidden

You don't have permission to access /current/alex/wp-content/themes/starkers/sprites.png on this server.