Many friends often encounter permission problems when operating PHP. I am here to talk to you about the permissions issue based on my past operating experience. Permission errors generally occur when reading and storing data. With that said, first let's talk about the most common system permission restrictions. PHP is the most widely used system LINUX/WIN32. Let's first talk about the common mistakes under LINUX. When the user accesses his own site http://mysite/ after activating the website, he finds that he cannot access it, and the prompt message is that access is prohibited. Q: Why can’t I access my website after it is configured? A: First log in to your machine (or ask your administrator to log in to the machine) and check whether your WEB directory has read permissions for group/other group users. Again, check whether your WEB server's directory settings allow browsing. This problem will probably be solved after modifying the corresponding data. If the above steps still cannot solve your problem, please continue reading below. If the HTML files in your website can be accessed normally, but some PHP files have permission issues when accessed, I am first of all happy to tell you that your WEB server is normal and its permissions are normal. And you just have a problem in your PHP file. For example, your PHP file uses code similar to the following ... Of course, you can easily understand the above code. In fact, I want to say An example is that you may have operations on files (a directory is a special file - the explanation of a directory under Linux), such as creating, deleting, and modifying. At this time, permission problems are mostly caused by the permissions of the file itself. Here we should learn about another piece of knowledge, system permissions/FTP permissions. What are system permissions? What are FTP permissions? Of course, this is just an explanation of the meaning based on my personal understanding, not a literal definition in the book. You can find more relevant definitions online, but you just need to understand their meaning. System permissions (note: the system mentioned here is the operating system): it is the permission restriction system for system users. FTP Countywide: It is a permission restriction system for FTP users. OK, here I have basically talked about the above nonsense. If your FTP user is the user in your system, you only need to assign permissions in the system to these directories to solve the problem. If your FTP system uses its own user system, then please continue to look down. We know that the system has allocated an area to the FTP service. The FTP service has certain permissions to operate this area. The FTP service has added its own User management, therefore under the constraints of system permissions, the FTP service performs a second permission allocation. The permission representation method under LINUX is also used. By now you should have questions like this Q: Why am I still being told about permission issues even though my system permissions are normal? A: Under the constraints of system permissions, your FTP may have its own user management system, so you should now use an FTP client to log in to your FTP host and perform permission operations on files. The specific operation steps are explained in the help pages of many ISPs, so I won’t go into details here. After reading the above content, 90% of your file permission problems should be solved. If you belong to the 10%, welcome to discuss with me ~ Another: For users under the WIN32 system, if your partition is in NTFS format, you can refer to the above. If you are non-NTFS, you can refer to FTP permissions. The storage of data is not only directly to File operations also include databases and data flow databases: Here we will take PHP combined with MYSQL as an example. MYSQL has its own permission system, so a good DBA will always reasonably allocate permissions to database users. Database Permission problems are mostly concentrated in the following points: 1. The connection to the host is refused 2. The connection account matches incorrectly 3. The connection account has insufficient permissions 4. The connection account operates a database that does not have permissions (this problem is the same as 3. In fact, the account in the county is insufficient) Data flow: PHP's data flow is mostly some functions that operate on the network. If errors occur in these functions, it is probably caused by the settings of the other party's server that prevent the data from being obtained. At this time, what you should consider is to modify the code starting from your program (unless you can operate your target host) Author: sports98