WordPress knowledge sharing

Record a case of WordPress website upload failure, unable to create directory and write file

Today, when helping people move from their website, we found that mp4 video files could not be uploaded on the new virtual host. Prompt: please check whether the superior directory is writable. After some operations to solve the problem, Lao Wei felt that this was a representative case, so he shared it for everyone to see.

Similar problems include:

WordPress encountered "Sorry, you don't have permission to upload this file type" How to solve this problem

How to allow WordPress to upload JSON files

Several solutions to failure caused by WordPress uploading pictures exceeding 2500 pixels

How to solve the problem that WordPress prompts "target directory already exists and installation failed"

Problem presentation

The user uses the godaddy virtual host, as shown in the following figure. The page prompts that the/uploads/2022/07 directory cannot be created. Is its parent directory writable?

 The page prompts that the/uploads/2022/07 directory cannot be created

This problem is seldom encountered, and it is really puzzling.

The main idea is to check whether relevant directories exist and whether they can be written.

problem analysis

Use Godaddy's cPanel panel to check the permissions of related directories, including the permissions of the/07 directory and the directories at the upper levels are 0755. After changing to 0777, the test still gives the same prompt.

The same is true for deleting the/07 directory. A new directory cannot be created.

stay WordPress Site Health Status In the information column of, I found that the uploads directory is not writable, so I transferred my solution to it.

Problem solving

In WordPress background>Settings>Media>File upload>Default upload path, it is found that the path name used is still the name of the old virtual host, that is, the string of characters after home in the figure below.

This is the cPanel used by godaddy. The new and old virtual hosts have different names.

 The cPanel used by godaddy has different names between the old and new virtual hosts

In this way, there is a solution. In the default upload path of WordPress, replace the old name with the name of the new virtual host. The other paths remain unchanged and save.

After testing, pictures and video files can be uploaded normally, and the problem is solved.

Like( two )
Article name: "Record a case of WordPress website upload failure, unable to create directory and write file"
Article link: https://www.vpsss.net/28689.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.