php 在执行此命令时出现的错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9951637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
an error occurred while processing this directive
提问by user1304317
On my site:
在我的网站上:
I keep getting erros all over my site when using PHP files that arent CHMOD to 644 or 755.
使用不是 CHMOD 为 644 或 755 的 PHP 文件时,我的网站上不断出现错误。
If I chmod recursively this directory 755 I get:
如果我 chmod 递归这个目录 755 我得到:
[an error occurred while processing this directive]
[在执行此命令时出现的错误]
And I f I chmod it recursively to 644 I get:
如果我将它递归地修改为 644,我会得到:
Forbidden
You don't have permission to access /disposable/admin/ on this server.
禁止的
您无权访问此服务器上的 /disposable/admin/。
Help? :( I use Hostmonster as my host. is it on their end?
帮助?:(我使用Hostmonster作为我的主机。是他们结束了吗?
回答by Abdul Jabbar
i come a cross with similar sort of issue, following solution work for me check your code you might have wrote a comment <!--#some comment-->" add space "<!--[add space ] #some comment [add space] -->" Like this "<!-- #some comment -->
我遇到了类似的问题,请按照我的解决方案检查您的代码,您可能已经写了一条评论 <!--#some comment-->" add space "<!--[add space ] #some comment [添加空格] -->" 像这样"<!-- #some comment -->
回答by BenOfTheNorth
I'd try claiming ownership of the files first with chown
- be careful with this though because if you set the permissions tightly and not loosely, you might have trouble accessing them any other way than through PHP itself.
我会尝试首先声明文件的所有权chown
- 但要小心这一点,因为如果您严格而不是松散地设置权限,除了通过 PHP 本身之外,您可能无法通过其他任何方式访问它们。
回答by Sabir Abdul Gafoor Shaikh
I resolved the issue by just adding the .htaccess file in the root directory with the default code and it started working. Also, after adding I need to update the permalink in the WP admin setting.
我通过使用默认代码在根目录中添加 .htaccess 文件解决了这个问题,它开始工作。此外,添加后我需要更新 WP 管理设置中的永久链接。
` # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress`
I hope this will help.
我希望这将有所帮助。
回答by Jitender Raghav
It's all about file permission issue, Now it's working for me...
这完全是关于文件权限问题,现在它对我有用......
Folder permission must be 744 other permissions like (752, 753, 756, and 777) cause limitation and will not work..
文件夹权限必须是 744 其他权限,例如(752、753、756 和 777)会导致限制并且不起作用。
File permission must be 644 other permissions like (642, 643, 646 and 647) cause limitation and will not work..
文件权限必须是 644 其他权限,如(642、643、646 和 647)会导致限制并且不起作用。
回答by Shiv
I faced the same issue. It happened when copied files from linux system to another server. I believe file permissions and group got messaged up.
我遇到了同样的问题。它发生在将文件从 linux 系统复制到另一台服务器时。我相信文件权限和组收到了消息。
I solved it by moving the files to windows PC where these permissions things are cleared and then unzip it on Linux server. Although its not the correct way but i find it simple enough to try once.
我通过将文件移动到 Windows PC 来解决它,在那里这些权限被清除,然后在 Linux 服务器上解压缩。虽然它不是正确的方法,但我发现它很简单,可以尝试一次。
回答by Lloyd95
As jktech11 says, its all about a permission issue. for me permission 755 for folders and permission 644 for files worked. FYI You can change the permission via file zilla or command prompt if its in local host.
正如 jktech11 所说,这完全是一个权限问题。对我来说,文件夹的权限为 755,文件的权限为 644。仅供参考,如果在本地主机中,您可以通过文件 zilla 或命令提示符更改权限。
回答by SDDev
SuPHP was the root cause of me getting this error. I switched to a new VPS and by default it was using SuPHP. I switched to use PHP-FPM which allowed the scripts with permissions 664 to execute properly.
SuPHP 是我收到此错误的根本原因。我切换到一个新的 VPS,默认情况下它使用的是 SuPHP。我改用 PHP-FPM,它允许具有 664 权限的脚本正确执行。
The current CRM I'm using had issues during the updates and they were failing because the file permissions set to 664 for some files which were part of the update. I couldn't change the permissions of these during the update process. It needed to be able to execute all the files otherwise the updates would fail.
我当前使用的 CRM 在更新过程中出现问题并且它们失败了,因为对于作为更新一部分的某些文件,文件权限设置为 664。我无法在更新过程中更改这些权限。它需要能够执行所有文件,否则更新将失败。
After the updates I run a script to reset the folders to 755 and files to 644.
更新后,我运行脚本将文件夹重置为 755,将文件重置为 644。
Hope this helps anyone who runs into this again.
希望这可以帮助任何再次遇到此问题的人。
回答by Kiren_pr
Check your html code for html commenting like <!--{space}comment-->
if there is, then remove the space and upload the html file. Hope it helps!
检查您的 html 代码<!--{space}comment-->
是否有html 评论,然后删除空格并上传 html 文件。希望能帮助到你!
回答by Hugo
I tried all the solutions here and non worked for me.
我在这里尝试了所有解决方案,但对我不起作用。
Actually the shell help file was the one that properly helped me correct permissions and I advise anyone to do this.
实际上,shell 帮助文件是正确帮助我纠正权限的文件,我建议任何人都这样做。
When I typed:
当我输入:
ls -la public_html
I showed I had made a wrong user attribution to a folder cousin this same error message.
我表明我已经错误地将用户归因归于文件夹表亲同样的错误消息。
I tried all the solutions here and from many other threads but none worked. So I typed:
我在这里和许多其他线程中尝试了所有解决方案,但都没有奏效。所以我输入:
chown --help
and it showed me that I needed to use -hR Examples:
它告诉我我需要使用 -hR 示例:
Examples:
chown root /u Change the owner of /u to "root".
chown root:staff /u Likewise, but also change its group to "staff".
chown -hR root /u Change the owner of /u and subfiles to "root".
In my case:
就我而言:
chown -hR usernameiwanttoownthefile /home/rootpath/public_html/sitefolder
Fixed all my problems.
解决了我所有的问题。
回答by buzibuzi
i had this problem with justhost.com cpanel when creating the file from Aptana 3 using remote ftp connection. I solved it by creating the file using the Cpanel File Manager.
使用远程 ftp 连接从 Aptana 3 创建文件时,justhost.com cpanel 遇到了这个问题。我通过使用 Cpanel 文件管理器创建文件来解决它。