2

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

1 Answers1

2

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
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • 1
    php.ini in a project directory post_max_size= "2000M"; upload_max_filesize= "2000M"; memory_limit= "3000M"; max_execution_time= "2592000"; max_input_time= "2592000"; session.gc_maxlifetime= "1200"; – Hafiz Muhammad Kamran Jul 01 '14 at 08:41
  • htaccess, http.conf php_value post_max_size 2000M php_value upload_max_filesize 2000M php_value memory_limit 3000M php_value max_execution_time 2592000 php_value max_input_time 2592000 php_value session.gc_maxlifetime 1200 – Hafiz Muhammad Kamran Jul 01 '14 at 08:41
  • php file ini_set('safe_mode ', 'Off'); ini_set('max_input_time', '2592000'); ini_set('memory_limit', '3000M'); ini_set('post_max_size', '200M'); ini_set('upload_max_filesize', '200M'); ini_set('max_execution_time', '2592000'); ini_set('max_file_uploads', '100'); ini_set('session.gc_maxlifetime', '1200'); – Hafiz Muhammad Kamran Jul 01 '14 at 08:42
  • If you need to provide further info, please use the **edit** link and add it to the question itself. Code in comments is unreadable. If you're asking for some clarification about my answer, please explain your doubts, not just dump a bunch a code. – Álvaro González Jul 01 '14 at 08:59
  • i get my point it will not exceed the limit . i am using share package. past_max_size only increase in vpn server or buy your own server. – Hafiz Muhammad Kamran Jul 03 '14 at 07:50
  • 1
    That's not true. [post_max_size](http://www.php.net/manual/en/ini.list.php) is clearly documented as [PHP_INI_PERDIR](http://www.php.net/manual/en/configuration.changes.modes.php) since PHP/4.2.4. I'm changing it all the time. – Álvaro González Jul 03 '14 at 11:42