简体   繁体   English

在LAMP CentOS VPS上克隆Git存储库时出现500内部服务器错误

[英]500 Internal Server Error When Cloning Git Repo On LAMP CentOS VPS

Cloning or pulling a git repo using ssh (Laravel App) causes an internal server error when browsing to a php file. 浏览到php文件时,使用ssh(Laravel App)克隆或提取git repo会导致内部服务器错误。 Manually adding an index.php file and echoing something works fine. 手动添加index.php文件并回显某些内容效果很好。

I believe it is a file permission error but this only occurs on this server. 我认为这是文件权限错误,但这仅在此服务器上发生。 Every other server I clone to works off the bat. 我克隆的所有其他服务器都可以正常运行。

Any guidance would be greatly appreciated. 任何指导将不胜感激。

I faced the same problem and doing these instructions fixed it 我遇到了同样的问题,并按照以下说明进行了修复

one must pay careful attention to the insecure permissions of user's public_html folders. 必须注意用户的public_html文件夹的不安全权限。 The following commands will look in every user's html folder and make the appropriate CHMOD to allow php to properly execute under SUPHP. 下面的命令将在每个用户的html文件夹中查找并进行适当的CHMOD,以允许php在SUPHP下正确执行。 Don't forget to also check for files owned by 'nobody' or 'root' — they will also fail with a 500 error. 别忘了还要检查“ nobody”或“ root”拥有的文件-它们也会因500错误而失败。

find /home/*/public_html/ -type d -print0 | xargs -0 chmod 0755 # For directories
find /home/*/public_html/ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644 # For files
find /home/*/public_html/ -type f -name "*.cgi" -print0 -o -name "*.pl" -print0 -o -name "*.sh" -print0 | xargs -0 chmod 0755 # For CGI/Scripts

chmod all files and folders chmod所有文件和文件夹

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

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