简体   繁体   English

PHP require_once 无法打开流权限被拒绝

[英]PHP require_once failed to open stream permission denied

I keep getting the error below even after changing the permissions of the folder.即使在更改文件夹的权限后,我仍然收到以下错误。 I don't know what to do.我不知道该怎么办。 Not sure why.不知道为什么。 Any help would be greatly appreciated.任何帮助将不胜感激。 I'm working with Cent-os server and this is a php script.我正在使用 Cent-os 服务器,这是一个 php 脚本。

require_once(mysql_connect.php) [function.require-once]: failed to open stream: Permission denied Date/Time: 7-28-2009 20:09:44 require_once(mysql_connect.php) [function.require-once]:无法打开流:权限被拒绝日期/时间:7-28-2009 20:09:44

Things to check:检查事项:

  • The web server user (often apache ) executing the web script needs read ("r") permission on the included file.执行 web 脚本的 web 服务器用户(通常是apache )需要对包含的文件具有读取(“r”)权限。 The web server user is usually different than the user who wrote the files. Web 服务器用户通常与编写文件的用户不同。
  • Check that all the parent directories of the included file have the appropriate execute ("x") permission set.检查包含文件的所有父目录是否都具有适当的执行 ("x") 权限集。
  • The open_basedir php.ini setting. open_basedir php.ini 设置。 If this is configured to be on, you might have a limited set of file opening permissions.如果将其配置为开启,则您的文件打开权限可能有限。
  • Your SELINUX settings.您的 SELINUX 设置。

The problem was not a permission issue.问题不是权限问题。 The file I was including was named mysql_connect.php which I think conflicts with either one of mysql's files or functions so the server was confusing my file for that and wouldn't require_once() or include_once() or include() the file.我包含的文件名为 mysql_connect.php,我认为它与 mysql 的文件或函数之一冲突,因此服务器混淆了我的文件,并且不会 require_once() 或 include_once() 或 include() 文件。 Hence the permission denied fatal error.因此权限被拒绝致命错误。 I change the name of the file and all is well.我更改了文件名,一切正常。 Thanks to you all for trying to help me out.感谢大家试图帮助我。

暂无
暂无

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

相关问题 require_once:无法打开流:权限被拒绝(lampp) - require_once: failed to open stream: Permission denied(lampp) 警告无法打开流权限拒绝致命错误require_once PHP + NginX + RHEL in VMware - Warning failed to open stream permission denied fatal error require_once PHP + NginX + RHEL in VMware require_once(“ facebook-sdk / facebook.php”)引发警告“无法打开流:权限被拒绝” - require_once(“facebook-sdk/facebook.php”) throws a warning “failed to open stream:Permission denied” require_once(../../ path / to / script.php)打开流权限被拒绝 - require_once(../../path/to/script.php) failed to open stream permission denied PHP 警告:require_once(/var/www/html/wp-config.php):无法打开流:第 37 行 /var/www/html/wp-load.php 中的权限被拒绝 - PHP Warning: require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 37 PHP警告:require_once:无法打开流:在目录中没有这样的文件或目录 - PHP Warning: require_once: failed to open stream: No such file or directory in PHP 警告:require_once 无法打开流:中没有这样的文件或目录 - PHP Warning: require_once failed to open stream: No such file or directory in PHP-require_once:无法打开流:没有此类文件或目录 - PHP - require_once: Failed to open stream: No such file or directory PHP require_once 给出无法打开 stream 错误 - PHP require_once giving an failed to open stream error require_once:打开流失败 - require_once : failed to open stream
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM