Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that WordPress cannot move uploaded files to wp-content/uploads

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to solve the problem that WordPress cannot move uploaded files to wp-content/uploads. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Fixed that uploaded files cannot be moved to wp-content/uploads in WordPress

Set up a lnmp environment and put a wordpress station building system

The lnmp environment was built quickly, but there were some problems when putting wordpress.

The main question:

1. The first is that wp-content/uploads does not have permission to create

Create this manually by yourself and give it 777 permissions.

two。 The uploaded file cannot be moved to wp-content/uploads.

This is not only a major question, but also a troublesome one. Baidu's answer is to set 777 permissions in the same way, without a Chinese user name.

It's no use at all.

Describe the background before you get a solution.

When installing the lnmp environment, it is all installed by the root user, but when I put the program, I created a new morequ user, put all the programs under that user, and then used the nginx agent.

This gives rise to the problem of permissions.

Searched all over Baidu, it was of no use at all, and finally got an answer with bing search.

After changing it according to his method, even http couldn't pass, directly 500. after many efforts, I finally got the answer.

A) modify nginx.conf

At the beginning of this file, there is a place where user is set, which is changed to:

User root root;worker_processes 1

B) modify php-fpm.conf

I saw this sentence in this document:

; Include one or more files. If glob (3) exists, it is used to include a bunch of; files from a glob (3) pattern. This directive can be used everywhere in the; file.include=/etc/php-fpm.d/*.conf

You can go to this folder and have a look. There is a www.conf file in it.

Modify this file:

; Set permissions for unix socket, if one is used. In Linux, read/write; permissions must be set in order to allow connections from a web server. Many; BSD-derived systems allow connections regardless of permissions.; Default Values: user and group are set as the running user; mode is set to 0666umblisten.owner = morequ;listen.group = morequ;listen.mode = 0666; Unix user/group of processes; Note: The user is mandatory. If the group is not set, the default user's group; will be used.; RPM: apache Choosed to be able to access some dir as httpduser = morequ; RPM: Keep a group allowed to write in log dir.group = morequ

Change the original www user to my current user.

It turned out to be a success.

This is the end of this article on "how to solve the problem that WordPress cannot move uploaded files to wp-content/uploads". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report