i'm testing a website on my localhost not on the server
in php.ini max file size is 128 mb but i can't upload a 26 mb flv file it doesn't give me an error or anything the page just refreshes and nothing happens it doesn't upload but small large files are uploaded successfully any advice ?
Check upload_max_filesize and post_max_size in php.ini, .htaccess and web-server config. Make sure you're editing correct php.ini.
Yes, you'll need to ask to the hosting support via ticket. The limits depends from your hosting plan.
Related
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
I can't upload more than 8 MB files in PHP. I have added below lines in .htaccess file.
php_value upload_max_filesize 2048M
php_value post_max_size 2048M
This is working on localhost but not working on live server. I have contacted the support team of server and ask them to give rights to edit php.ini file but said you haven't any permission to update php.ini file.
Please help me regarding this issue.
Your webhost probably does not allow php.ini to be overridden by .htaccess. This is common on shared hosting. If you need to do large uploads you need to find a host that supports it or get a VPS.
There are some upload libraries which support partial/chunked upload, you can circumvent hoster restrictions with that, cause it uses multiple requests to upload one file. I use something like https://github.com/blueimp/jQuery-File-Upload most of the time when i have to handle big uploads.
My host is on a shared server so therefore i cannot change the php.ini. My goal is to upload files of upto 100mb but the servers upload_max_filesize is set to 6mb which i cannot change..
My quetsion is, is it possible to bypass this by uploading in chunks using something like https://github.com/blueimp/jQuery-File-Upload?
Many thanks in advance.
Ok I've now figured it..
By default chunking is not enabled.. you have to enable it in the jquery options, here is the source to do that https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads
For testing purposes i've changed my php.ini settings to accept only 1mb and i'm successfully loading files that surpass that max upload.
I am try to uploading file on WordPress server.after 8 mb uploading file is break.There are three ways to increase the size of the uploading file.
PHP.ini (Changing the settings of PHP.ini file)
htaccess (Also change the settings in htaccess file but still of no use)
changing settings in wp-admin file.
all are not working.
Is it any other way to increase the size of the uploading file.
You have to configure this two things in php.ini upload_max_filesize and post_max_size then restart your webserver
Apart from the maximum filesize setting, try to look and configure max_execution_time and post_max_size in the php.ini if necessary. Then,restart Apache.
It depends on where you are uploading file ie. On which site.
What is your connection bandwidth.
How much uploading your WordPress service provider supporting.
Your script can have a limited set of time to be executed.
Try set the request timeout inside the php script with set_time_limit() (for a test on time limit, not for an upload)
Often, when the limit is represented by the size of file, you should have a message warning before the upload starts. In this case the server is letting you upload, so in most cases it's not a size problem.
Take into account also that some providers are imposing execution time from web server setup so you have to check this too. If I were you I'll try to execute a script that does nothing (wait) for some minutes, and see if that the time the request goes in timeout is the same for uploading a file.
I am trying to upload a file of 1GB size using php script and it works perfectly if file size is less than 20MB, but when I increase the file size than after pressing upload button on website, it uploads the file (I guess as it takes few minutes) and after that, instead to execute upload.php, my firefox asks me to download upload.php, so I guess, file is being uploaded but my php script fails to execute.
Also after searching in google I found following settings for php.ini which I made and my php_info() function shows me that settings have been changed..
/*php.ini start*/
memory_limit = 512M
post_max_size = 15000M
file_uploads = On
upload_max_filesize = 15000M
max_input_time = 20000
max_execution_time = 20000
session.gc_maxlifetime = 20000
/*php.ini end*/
The limit on file size uploads is limited by a LOT more than just PHP. PHP has its limits, Apache has its limits, many web services have their own limits, and then you have the limit on the /tmp directory size which could be set by user permissions on a shared host. Not to mention just running out of hard drive space!
Your php.ini looks good, but as was already suggested- check the LimitRequestBody in Apache and make sure your web service allows this.
One common solution when you need to upload very large files is to use Flash or Java on the client-side since these have access to the client's actual file system. The Flash/Java can then break the file into small pieces which are sent one at a time and re-assembled on the server side. This has multiple benefits. First, you can resume broken downloads. Second, you don't have to worry about any scripts timing out. Third, it bypasses any possible file system limits that may be in play from PHP, Apache, web services, or other sources.
post_max_size = 15000M should be higher than upload_max_filesize = 15000M.
It can be either post_max_size = 15001M. I've increased it to 1 more.
Check that your web server also allows such large uploads. On Apache the setting is LimitRequestBody. This limit is be applied long before PHP ever enters the picture and cannot be changed/overriden from within PHP.