1

I have created a local WordPress 4.9.8 setup with PHP 7 inside a Fedora running machine. When I try to upload media into the WordPress admin, it keeps saying that

The uploaded file could not be moved to wp-content/uploads/

I have given full(777) file permission for content/uploads directory but still, I get the same error.

Finally, I tried to create the directory structure manually and place the media file by myself as follows

/var/www/html/test-jp/wp-content/uploads/2018/09/1024-xxxxx-logo.png

What may be the reason?

2 Answers 2

0

This may due to the SELinux feature of the Fedora OS.

You can temporarily disable the SELinux in Fedora as follows and test.

Check SELinux status as sestatus

If the SELinux is active, the result for the above command will be included.

Current mode: enforcing

Execute command sudo setenforce 0 to temporarily disable SELinux

Then if you check sestatus

Current mode: permissive

To re-enable SELinux execute command sudo setenforce 1

0

Check also the owner of the wp-content/uploads folder, which should be set to the user under which the web server is running, usually this user is www-data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.