简体   繁体   English

在执行此命令时出现的错误

[英]an error occurred while processing this directive

On my site: 在我的网站上:

http://bammeh.com/tempemail/ http://bammeh.com/tempemail/

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作为我的主人。它是在他们的结尾?

我遇到类似问题的十字架,按照我的解决方案工作检查你的代码你可能已经写了一个评论<! - #tome comment - >“add space”<! - [add space] #some comment [添加空间] - >“喜欢这个”<! - #some comment - >

我首先尝试使用chown声明文件的所有权 - 但要小心这一点,因为如果你设置权限而不是松散,你可能无法通过PHP本身以任何其他方式访问它们。

I resolved the issue by just adding the .htaccess file in the root directory with the default code and it started working. 我通过使用默认代码在根目录中添加.htaccess文件解决了这个问题,并且它开始工作。 Also, after adding I need to update the permalink in the WP admin setting. 此外,添加后我需要更新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. 我希望这将有所帮助。

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)导致限制,将无法正常工作..

As jktech11 says, its all about a permission issue. 正如jktech11所说,这完全是关于许可问题。 for me permission 755 for folders and permission 644 for files worked. 对我来说,755用于文件夹,权限644用于文件工作。 FYI You can change the permission via file zilla or command prompt if its in local host. 仅供参考您可以通过文件zilla或命令提示符更改权限(如果它在本地主机中)。

SuPHP was the root cause of me getting this error. SuPHP是我收到此错误的根本原因。 I switched to a new VPS and by default it was using SuPHP. 我切换到新的VPS,默认情况下使用的是SuPHP。 I switched to use PHP-FPM which allowed the scripts with permissions 664 to execute properly. 我切换到使用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. 我正在使用的当前CRM在更新期间出现了问题并且它们失败了,因为对于作为更新一部分的某些文件,文件权限设置为664。 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. 它需要能够执行所有文件,否则更新将失败。

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. 希望这可以帮助任何再次遇到这种情况的人。

I faced the same issue. 我遇到了同样的问题。 It happened when copied files from linux system to another server. 它发生在将文件从linux系统复制到另一台服务器时。 I believe file permissions and group got messaged up. 我相信文件权限和组已经收到消息。

I solved it by moving the files to windows PC where these permissions things are cleared and then unzip it on Linux server. 我通过将文件移动到Windows PC来解决它,这些权限被清除,然后在Linux服务器上解压缩。 Although its not the correct way but i find it simple enough to try once. 虽然它不是正确的方法,但我觉得它很简单,尝试一次。

i had this problem with justhost.com cpanel when creating the file from Aptana 3 using remote ftp connection. 我使用远程ftp连接从Aptana 3创建文件时,justhost.com cpanel出现此问题。 I solved it by creating the file using the Cpanel File Manager. 我通过使用Cpanel文件管理器创建文件解决了这个问题。

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. 解决了我所有的问题。

Check your html code for html commenting like <!--{space}comment--> if there is, then remove the space and upload the html file. 检查您的html代码是否有<!--{space}comment-->等html评论,如果有,请删除空格并上传html文件。 Hope it helps! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM