Home > Article > Backend Development > What should I do if php cannot create a directory under Linux?
Solution to the problem that php cannot create a directory: First, use the command "ps -e -f | grep php" to find the user group to which php belongs; then use the chown command to change the owner of the specified file to the specified user or group That’s it.
Recommended: "PHP Video Tutorial"
php cannot create folders and files under Linux Question
The same code for creating a folder works under Windows, but not under Linux.
Then I checked the information. It was found that it was a permissions issue
You can know the user/group to which php belongs by running ps -e -f | grep php.
I am apache here
Then if you want to create or delete a directory or subdirectory under a certain folder,
Use chown to change the owner of the specified file For the specified user or group
The above is the detailed content of What should I do if php cannot create a directory under Linux?. For more information, please follow other related articles on the PHP Chinese website!