Solution to 'Unable to move uploaded file to' error in WordPress, wordpress solution_PHP tutorial

WBOY
Release: 2016-07-13 09:47:51
Original
823 people have browsed it

Solution to the "Unable to move uploaded file to" error in WordPress, wordpress solution

Today I uploaded images to the blog on the web page, and the result was: "Unable to move the uploaded file to" The file was moved to /home/wwwroot/wp-content/uploads/2013/". I was depressed. I thought it was a permission issue. I modified the file and changed it to 777 permission, but it still cannot be written and pictures cannot be uploaded.
Simply, I checked the permissions of the root directory folder of my website, and it showed www, www, and using ps aux|grep nginx showed that running the nginx subroutine as nobody, ps aux|grep php-fpm, showed Also nobody. At the same time, I found that the permissions of other files and folders in my website are root, root. This may be caused by the fact that I copied directly as root last time, so I cannot modify root's files as nobody.
Here’s how:
Step one:
First change the running identities of nginx and php-fpm subprograms to www, and the user group group to www.
Modify the nginx.conf file and change user nobody nobody; to user www www;
Run command:

service nginx restart       //重启nginx
Copy after login

Modify php-fpm.conf and replace

  user = nobody
  group = nobody

Copy after login

changed to:

  user = www
  group =www

Copy after login

Run command: service php-fpm reload //Restart php-fpm
Step 2:
Modify all folders and files to www, www

#chown -R www:www /wwwroot
Copy after login

Upload the image again, and it will prompt that the upload was successful and the problem is solved.
There are some other methods on the Internet, such as changing the picture to English name, or changing the folder to 777. In fact, in many cases, the permission is 777, but still cannot be uploaded. You can consider whether the file owner is the problem.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1024930.htmlTechArticleSolution to the "Unable to move uploaded file to" error in WordPress, wordpress solution to upload images on the web page today Go to the blog, and the result prompts: "Unable to move the uploaded file to...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template