问题
Details :- Stack : WAMP
OS : Windows 7.
I am using Laravel 4 and I know by using ini_set('post_max_size','40M');
we can manually set the php.ini post_max_size
value.
The index.php file inside laravel's public/ folder runs the first time the project is opened so I wrote ini_set('post_max_size','40M');
inside that public/index.php
file and started the app once again but when i tried to see the value of post_max_size by using echo ini_get('post_max_size');
it shows 3M that is by default in the php.ini file .
Does laravel has some limitation while setting the php.ini values manually or am i doing something wrong ?
I want to set that value by programmatically, NOT by going inside the php.ini and changing the value there.
Note: I also tried writing the code inside a helper file and called that file in autoload but that also didn't worked this means ini_set('post_max_size','40M');
is not at all working.
回答1:
That is a value you can not set programatcally. You can see a table of all the variables in php.ini and when you can and can't change them here...
http://php.net/manual/en/ini.list.php and http://php.net/manual/en/configuration.changes.modes.php
"Entry can be set in php.ini, .htaccess, httpd.conf or .user.ini (since PHP 5.3)"
If you have access to your htaccess file, instead you can do...
php_value post_max_size 40M
来源:https://stackoverflow.com/questions/25250527/cannot-set-post-max-size-in-laravel-4