Home>Article>Backend Development> php cannot create folder

php cannot create folder

藏色散人
藏色散人 Original
2019-10-02 09:47:29 4442browse

php cannot create folder

php cannot create the folder?

Upload, folder creation failed:

php cannot create folder

Check the function description in the official PHP documentation:

php cannot create folder

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:

php cannot create folder

So, add the third parameter to the mkdir function to open Recursive mode:

Example: mkdir($uploadpath,0777,true);

php cannot create folder

Upload the image again, successful! !

php cannot create folder

For more PHP knowledge, please visitPHP 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn