Issue uploading Images into WordPress - php

When trying to upload images into WordPress, I keep getting this error:
413 Request Entity Too Large
nginx
I checked PHP.ini file to make sure I have the proper upload-able amount and I have 32mb
I have a dedicated server with Media Temple and have never had this issue before. Hope someone could shed some light?
The file sizes I am uploading are about 1 - 3 mb. Anything less than 1mb seems to go through.

This is not a php.ini issue. The error is coming from the web server nginx.
Add this line somewhere in your nginx server block (change 5M to whatever you need):
client_max_body_size 5M;

Try the following in your php.ini file and then restart the server. Restarting the server is key.
memory_limit 20MB
post_max_size 20MB
upload_max_filesize 20MB
max_execution_time 600

Related

Why can't I upload large files on my PHP website?

I am having a problem with uploading files bigger than a certain size (around 150MB/200MB) to my server.
Because I do not have this problem on my local server, I suspect it has something to do with settings on the shared server which I rent that runs Apache.
The error that I am getting is HTML error 413 Request Entity Too Large
Ofcourse I have done some research and found that the php settings on the server are set correctly as follows:
max_input_time = 24000
max_execution_time = 24000
upload_max_filesize = 2048M
post_max_size = 2048M
memory_limit = 4096M
max_input_vars = 2000
Furthermore, because the server runs on Apache, I made sure to also add
LimitRequestBody 2147483647 and
SSLRenegBufferSize 2147483647 to the .htaccess file which translate to 2GB for both settings.
For the code I just use the PHP move_uploaded_file($_FILES["video"]["tmp_name"], "../videos/". $newVideoName)) method which, one again, does work with smaller files.
Is anyone familiar with this problem or have any other solutions on how to fix this problem? I did talk the my host and they have said that there aren't any restriction on uploaded filesizes other than the PHP settings which I have changed.
Thanks upfront!

File not upload

I am uploading a file In Laravel. If I upload a file of 2 MB then it is working, but If I upload a file of 10 MB it is not working. If I check php.ini it shows max_post_size 1024 MB and max_file_upload 1024 MB.
It is working fine on local. I am using centos and nginx server.
Probably you should change your php configuration file to allow receipt of bigger files. See the accepted answer to the question "Change the maximum upload file size"
Update: "By default, Nginx has a limit of 1MB on file uploads. To set file upload size, you can use the client_max_body_size directive, which is part of Nginx’s ngx_http_core_module module. This directive can be set in the http, server or location context."
For details see https://www.tecmint.com/limit-file-upload-size-in-nginx/
Do you after changing max_post_size and max_file_upload restart nginx service?
Maybe in error log you saw the answer:
/var/log/nginx/nginx_error.log

Large file size file not able to upload, return 500 internal error

I'm using Godaddy linux share hosting, and using the php.ini to configure the file upload max size
file_uploads = On
post_max_size = 100M
upload_max_filesize = 100M
but this is not working, the max filesize that allow is 2mb, although i configure already, i have tried the "php5.ini", "php56.ini" and store it in "/public_html/" or "root" folder, it still not working, at first i suspect it is the problem of SSL, because i just install SSL 2 weeks ago, but i found that my another hosting account(no SSL installed) that i configured before and tested before and show it is working correctly also have same problem,
Can i know what problem? is it only me encounter the this problem? and how to fix it?
I found the answer, we can straight away change the max upload size in system, follow this tutorial, https://www.youtube.com/watch?v=YmS92xfmbFU

413 Request Entity Too Large (Wordpress Laravel Forge)

It's my first time to use WordPress using laravel forge. I already installed WordPress but the thing is when I upload a new theme .zip file, I notice that the upload is running but after that it says:
413 Request Entity Too Large
Tried also changing these lines below inside site FPM Configuration
memory_limit = 256M
pload_max_filesize = 50M
post_max_size = 60M
I think I need to set the filesize capacity on nginx but I don't know where it's lcoated . Any help would be much appreciated. Thanks!
Go to your server configuration > PHP options at Forge, there you will find option to increase max file upload size.
Hope this helps!
The issue is related to the nginx server's buffer memory. Try increasing the following parameter:
http {
client_max_body_size 20M;
}
You can do this in the server's nginx file in forge panel.

upload_err_partial error when uploading files of size greater than 3GB

I want to upload upto 10GB files using a normal php form. But even after increasing the below values,
upload_max_filesize
post_max_size
php_value upload_max_filesize
php_value post_max_size
request_terminate_timeout
FcgidMaxRequestLen
am able to upload a file upto 3.5gb without any problem. But above that am getting an error as "upload_err_partial". I also reffered a lot of site but the answer I thought releavant was adding "header(connection:close)". I added the line but still I did not get any result. Could anyone guide me in this.
This error usually means that the uploading is cancelled by the user , and some times it can be server problem also which can cause this. Try to contact to your hosting provider and see what can he do

Categories