Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set post_max_size on apache server with htaccess (getting internal server error)

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?

like image 345
YemSalat Avatar asked Jan 02 '13 16:01

YemSalat


1 Answers

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.

like image 90
Álvaro González Avatar answered Nov 15 '22 08:11

Álvaro González