[英]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:检查事项:
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 服务器用户通常与编写文件的用户不同。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.