ini_set('post_max_size', '200M') did not work in php 5.4

Hafiz Muhammad Kamran picture Hafiz Muhammad Kamran · Jul 1, 2014 · Viewed 16.8k times · Source

ini_set('post_max_size', '200M') did not work in php 5.4 i had use following method. .htaccess , user.ini , php.ini , php5.ini but it did not effect of post_max_size. it remain on 64M. it change the memory limit and execution time but did not change the post_max_size.

phpinfo(); system information PHP Version 5.4.29 System Linux gator4143.hostgator.com 3.2.54 #9 SMP Thu Feb 13 08:17:11 CST 2014 x86_64 Virtual Directory Support disabled

Answer

Álvaro González picture Álvaro González · Jul 1, 2014

All those you mention are configuration files. In configuration files you simply cannot run PHP code because they are not scripts. You have to use the corresponding syntax (just check other directives on the same file). Typically:

  • php.ini, .user.ini → post_max_size = "200M"
  • .htaccess, httpd.conf → php_value post_max_size 200MB