简体   繁体   English

所有者只读写文件,显示PHP包含文件中的错误

[英]Owner Read Write Only Files Showing Error on Include Files in PHP

I have a PHP file in which I'm including some other files in same folder. 我有一个PHP文件,其中在同一文件夹中还包含其他文件。 They are database connection and query files. 它们是数据库连接和查询文件。 When I'm giving those included files only owner read and write only access then when I'm running the main file where they are included, its throwing SQL exception there. 当我只授予那些包含的文件所有者仅读写访问权限时,当我运行包含它们的主文件时,它将在其中抛出SQL异常。 When I'm giving permission for readable for others then it works. 当我授予他人可读性的许可时,它就会起作用。 Is it true that if files are owner read and write only then it wont work in the main file on running browser? 是真的,如果文件是所有者只能读写的文件,那么它将无法在正在运行的浏览器上的主文件中工作? Or is there any way of keeping access only to owner for included files? 还是有什么办法可以只保留所有者对包含文件的访问权限?

you said that your app is throwing an SQL exception. 您说您的应用抛出了SQL异常。 That implies that the error is coming when your php code attempts to access your database manager rather than a php include error. 这意味着当您的PHP代码尝试访问数据库管理器而不是php include错误时,错误即将来临。 If the php files were not being included, you should get an HTTP500 error when php encounters a variable or function in those included files that it cannot access. 如果未包含php文件,则当php在无法访问的包含文件中遇到变量或函数时,您将收到HTTP500错误。 Because you're getting an SQL error, I would check to see what user id is being used to access your database and if that userid has the correct permissions in the database to access the tables needed by the SQL statements. 因为您遇到了SQL错误,所以我将检查使用哪个用户ID来访问数据库,以及该用户ID在数据库中是否具有访问SQL语句所需表的正确权限。

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

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