php cannot create the folder?
Upload, folder creation failed:
Check the function description in the official PHP documentation:
mode has been specified as: 0777. Why is it still reporting an error saying that it does not have permission? ?
After carefully reading the document, I found that this involves a recursive mode, and the directories that may be created exist in multi-level directories. The current directory to be created in the project: 20160704, it should be in the online/thum/img folder:
So, add the third parameter to the mkdir function to open Recursive mode:
Example: mkdir($uploadpath,0777,true);
Upload the image again, successful! !
For more PHP knowledge, please visit PHP Chinese website!
The above is the detailed content of php cannot create folder. For more information, please follow other related articles on the PHP Chinese website!