My cilent is using Apache server deployed on Linux OS. Application allows files upto 50MB but its throwing errors when uploaded more than 2MB. I searched online and found limit can be increased by below options:
post_max_size & upload_max_filesize
But these two parameters are not found in httpd file. So could anyone here please help me which values i need to set to increase file upload limit?
You don't need to do anything in your httpd file.
For increase files size you need to edit php.ini where you find this two optins :
post_max_size & upload_max_filesize
For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder).
Under Linux, most distributions put lampp under /opt/lampp, so the file can be found under /opt/lampp/etc/php.ini.
Find and set the following two values:
post_max_size = 100M
upload_max_filesize = 100M
Save and close the file and restart Apache server.
Related
My client is having issues uploading into October CMS's Media Library a video that is more than 256 MB.
Is there a setting to lift this limit either in AWS or in October CMS config/filesystem.php or elsewhere?
Thank you.
You should change your PHP configuration, edit php.ini and change the following value:
post_max_size = 300M
upload_max_filesize = 300M
memory_limit = 700M
For more info read the following thread in October CMS website:
https://octobercms.com/forum/post/media-error-after-uploading-a-file
I am using a slightly modified version of phUploader script that works fine for small files. But when I try to upload files larger than 1MB it fails by giving this undescriptive error:
General upload failure.
Nginx error log does not show any evidence. I have set
upload_max_filesize = 200M
post_max_size = 200M
memory_limit = 128M
in the php.ini
and
client_max_body_size 200M;
in nginx.conf.
The odd thing is that the script used to work well on the same server (before an upgrade on Debian 6 server) and already works well on another Debian 6 server with the same nginx and php configs. So I'm really out of ideas and appreciate your hints.
You're getting an undescriptive error because the script you're using isn't properly displaying the actual error (line 252).
Modify the script to echo or log the value of $_FILES['file']['error'] instead of "General upload failure." Then, you should see a more appropriate error code. The PHP Manual has a section that explains what the error codes mean.
I am trying to increase the maximum post size limit on my server.
Here is the .htaccess file:
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200
However it does not seem to work and throws a 500 Internal server error.
Any ideas why this could be happening and how to overcome this?
As far as I can tell, your syntax is correct. However, the php_value Apache directive is provided by the mod_php module. If you don't run PHP as Apache module (e.g., it runs as FastCGI or with some other SAPI) that directive won't be defined, thus the 500 error.
There're many ways to change PHP settings. In practice, I've found that hosting services that run CGI often provide a custom php.ini file somewhere in your FTP account. Additionally, if you run PHP/5.3.0 or newer you can use .user.ini files. Last but not least, there's ini_set() within code.
I am running an Apache 2.2.3 proxy server to hide my backend machines from users. I added a file upload service to my webservices; however, files larger than 128 kb are returning http Status Code of 413. I know this means Request entity too large, and I have scoured the internet looking for a solution.
I have changed my php.ini file to have max_execution_time = 3000, max_input_time = 6000, memory_limit = 128M, post_max_size = 20M, upload_max_filesize = 20M, default_socket_timeout = 6000. This didn't help, as I suspected it wouldn't. I am doing a Rest call from Java for the webservice it is not PHP.
I have changed the maxHttpHeaderSize in server.xml to 20000000 on the proxy connector to try to allow for more information to flow through. Again this did nothing and my limit is still at 128 kb.
I have also added the LimitRequestBody 20000000 Directive to the Location block for the webservice files will be uploaded from. This again didn't work.
Currently all 3 are in place without any improvement. I am still only able to send max 128 kb files through the proxy.
When I try to send a file directly to the backend machine without using the proxy it works perfectly fine without taking into account the size.
Any suggestions on how to fix this will be very much appreciated.
Thank you.
I have figured out what the problem was, and where the 128k limit occurs.
In mod_ssl it uses the default ssl negotiation size as 128k, when doing an upload we automatically renegotiate for security purposes.
I had to add and modify the SSLRenegBufferSize directive in the Locations and Directories that needed a larger than 128k buffer on renegotiation. This has worked like a charm for me.
Hope it helps anyone else that experiences this limit, or had this question.
hope someone can help as I'm not sure what's going on here - I have a live site where I want to allow file uploads of over 2MB. I have set the standard config options in php.ini as follows (running phpinfo() shows these settings fine):
upload_max_filesize 25M 25M
post_max_size 25M 25M
max_input_time 60 60
memory_limit 32M 32M
I also have the same config on a mirror server, where uploads of >2MB also don't work. Both of these servers are CentOS running php 5.1.6, with safe mode on. If I try out the settings above on a local LAMP set up on my laptop, the uploads work fine. So does anyone know if the problem could be a restriction of safe mode or if there are any other settings I need to configure?
Thanks in advance for any pointers.
Maybe this input in a Drupal forum might help.
Did you apply the enctype in your form defenistion?
<form id="putFile" enctype="multipart/form-data" action="...." method="post">