can PHP manipulate a path other than the root directory of the server?
Like a folder on the F drive.
Is there a way?
Ask the warrior to say deep-seated reasons, thanks!
Reply content:
can PHP manipulate a path other than the root directory of the server?
Like a folder on the F drive.
Is there a way?
Ask the warrior to say deep-seated reasons, thanks!
The so-called root directory of the Windows platform may refer to the system directory, or the drive letter directory.
The root directory in UNIX and LINUX/GNU systems refers specifically to root directories and '/'
Let's discuss your question.
Split Line
PHP is an explanatory language. An explanatory language program does not need to be compiled, and it needs to be compiled immediately by the PHP interpreter when running the program. There is no doubt here, the PHP interpreter is included in the PHP package (not a small explanation, there is time to turn over the information). We explain the PHP language in the local is not any use, with PHP is naturally to his expertise to do web development. Then we need a Web server software to drive the PHP interpreter, so that the browser and the server form the HTTP protocol communication.
PHP supports many Web server software: Apache, Nginx, Microsoft Internet Information Server (IIS), Personal Web Server (PWS), Netscape, iplant Server, oreilly Website Pro server, Caudium, Xitami, OMNIHTTPD, and more. Here we choose the most familiar Apache for example.
We can configure PHP to run as a CGI script or Apache module or fastcgi mode in Apache. The default, such as in the Windows platform, is basically to run as an Apache module. is Apache run interpreter, it is natural that we use the PHP language to delete and change files are Apache user identity to execute.
For example, the Apache configuration user and user group are www/www. (There is an Apache handbook of Jin Bu translations on the web, which is interesting to Google).
Windows platform (for many years do not use it, if the explanation is wrong please include)
- FAT32 partition mode, there is no file permission on Windows. Naturally, no matter which disk the PHP is placed on. PHP can create files or folders as long as the system can access the drive letter.
- NTFS partition, file permissions have been introduced. Here, you need to identify whether Apache users have permissions in the directory under which they want to operate, or if none of them can produce an action.
UNIX, Linxu/gnu
- Excellent design of file system permissions. In addition to basic read and write execution permissions, you can define hidden properties and file special permissions, among other things. and Linux user management to build users and user groups. So we have to follow the file permissions and user rights to apply PHP action. Detailed information can be found in Google search. Linux file permissions |linux accounts and user groups.
Split Line
Permission section, I will not explain. Basically the underlying point of your needs is fundamentally complete.
Yes, we need to see if PHP's running users have write access to the target folder.
chmod +w Directory