不能在laravel 4中设置post_max_size [英] cannot set post_max_size in laravel 4

查看:625
本文介绍了不能在laravel 4中设置post_max_size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

详细信息: - 堆栈:WAMP
操作系统:Windows 7.

我使用Laravel 4,我知道通过使用 ini_set('post_max_size','40M') ; 我们可以手动设置php.ini post_max_size 值。
Laravel的public /文件夹中的index.php文件第一次运行项目被打开,所以我在 public / index.php 中写了 ini_set('post_max_size','40M'); 文件,并再次启动应用程序,但当我试图通过使用 echo ini_get('post_max_size'); 看到post_max_size的值显示3M是默认在php .ini文件。

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 .

laravel在手动设置php.ini值时会有一些限制吗?

我想通过编程方式设置该值,而不是通过访问php.ini并更改该值。


注意:我也尝试在帮助文件中编写代码,并在自动加载中调用该文件,但也没有工作这意味着 ini_set('post_max_size','

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.

推荐答案

这是一个无法设置的值程序化。你可以看到一个表格中的所有变量在php.ini,当你可以和不能在这里更改...

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 http://php.net/manual/en/configuration.changes.modes.php

可以在php.ini,.htaccess,httpd.conf或.user.ini中设置条目(自PHP 5.3开始)

"Entry can be set in php.ini, .htaccess, httpd.conf or .user.ini (since PHP 5.3)"

如果你有权访问你的htaccess文件,你可以...

If you have access to your htaccess file, instead you can do...

php_value  post_max_size 40M

这篇关于不能在laravel 4中设置post_max_size的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆