Home  >  Article  >  System Tutorial  >  How to handle HTTP errors when uploading resources in WordPress

How to handle HTTP errors when uploading resources in WordPress

WBOY
WBOYOriginal
2024-07-25 13:39:11220browse
Brief description

Build an internal video learning website within the company, and after comparison, WordPress was chosen to build the site. However, various problems were encountered while uploading the video, so we will record the process.

Cause troubleshooting
1. When the upload progress of an mp4 file of more than ten megabytes reaches 100%, the media will prompt an http error

How to handle HTTP errors when uploading resources in WordPress

2. At first, I suspected that it was the upload size limit of PHP and Nginx. But looking at the PHP and Nginx configurations, they are all configured with 1000M
vim /etc/nginx/conf.d/default.conf
location / {
        root   /data/web;
        index  index.php index.html index.htm;
        client_max_body_size    000M;
}

vim /etc/php.ini
    upload_max_filesize = 000M
    post_max_size = 000M
    max_execution_time = 300
3. View Nginx erro log
tail /var/log/nginx/error.log
2018/02/14 09:32:07 [error] 87522#87522: *1 client intended to send too large body: 35016434 bytes, client: 36.111.88.33, server: localhost, request: "POST /wp-admin/async-upload.php HTTP/1.1", host: "117.66.240.116:81", referrer: "http://117.66.240.116:81/wp-admin/media-new.php"

Only the following line is the most important saving information. The following error is the problem of body size limit

client intended to send too large body
4. After setting the size limit in http, there will be no limit on the uploaded resources
vim /etc/nginx/nginx.conf
http{
    client_max_body_size    1000M;
keepalive_timeout  300;
}

The above is the detailed content of How to handle HTTP errors when uploading resources in WordPress. 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