laravel 在 Homestead 中配置 php.ini

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32729033/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:23:50  来源:igfitidea点击:

Configuring php.ini in Homestead

phplaravelhomestead

提问by jstein

I am trying to change the variable max_input_varsin my php.ini file by specifying

我试图通过指定来更改我的 php.ini 文件中的变量max_input_vars

; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 2500

and running

和跑步

sudo nginx -s reload

Even though I set this variable to 2500 on both my local machine (C:\xampp\php\php.ini) and on Homestead (/etc/php5/fpm/php.ini), I keep receiving the following error message

尽管我在本地机器 (C:\xampp\php\php.ini) 和 Homestead (/etc/php5/fpm/php.ini) 上将此变量设置为 2500,但我仍然收到以下错误消息

  parse_str(): Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini

I know .htaccess overrides php.ini on a per site basis, are there any other files which override php.ini? Are there any other services that need to be reloaded after changing the php.ini file?

我知道 .htaccess 会在每个站点的基础上覆盖 php.ini,是否还有其他文件会覆盖 php.ini?更改php.ini文件后是否还有其他服务需要重新加载?

采纳答案by rigobcastro

Have you tried this?

你试过这个吗?

ini_set('max_input_vars', 2500);

At the beginning of this file bootstrap/autoload.php

在这个文件的开头 bootstrap/autoload.php

回答by mpalencia

On the latest laravel homestead, php.ini is located in

在最新的laravel宅基地上,php.ini位于

/etc/php/7.0/fpm/php.ini

(Make sure you enter into ssh in to the homestead environment)

(确保进入ssh进入homestead环境)

try to edit it using

尝试使用编辑它

sudo su

回答by theRana

The overall configure process is pretty simple. The latest version of PHP in Homestead is 7.1

整个配置过程非常简单。Homestead 中 PHP 的最新版本是 7.1

SSH to the virtual machine by homestead ssh

通过 homestead ssh SSH 到虚拟机

Then edit the php.ini file with vim

然后用vim编辑php.ini文件

sudo su
vim /etc/php/7.1/fpm/php.ini 

Search 'max_input_vars' on php.ini file from vim by /max_input_vars

在 php.ini 文件上从 vim 中搜索 'max_input_vars' /max_input_vars

Go to that line and edit the value.

转到该行并编辑值。