简体   繁体   English

无法更改 PHP 中的 max_input_vars

[英]Can't change max_input_vars in PHP

I need to raise the max_input_vars value in php for a moodle installation.我需要提高 php 中的 max_input_vars 值以安装 moodle。 However when I change the value in my php.ini file the moodle web installer still prompts:但是,当我更改 php.ini 文件中的值时,moodle web 安装程序仍然提示:

PHP setting max_input_vars must be at least 5000.

phpinfo() shows: phpinfo() 显示:

max_input_vars => 5000 => 5000

also editing the .htaccess file had no effect.同样编辑 .htaccess 文件也没有效果。

Create a temporary php file in the Moodle directory with the following and run it via the browser (running php via the command line uses a different php ini file not the apache file)使用以下内容在 Moodle 目录中创建临时 php 文件并通过浏览器运行它(通过命令行运行 php 使用不同的 php ini 文件而不是 apache 文件)

<?php

phpinfo();

This will confirm which php ini file is being used, eg /etc/php/xx/apache2/php.ini这将确认正在使用哪个 php ini 文件,例如/etc/php/xx/apache2/php.ini

Also search the page for max_input_vars to see what the value is.还可以在页面中搜索max_input_vars以查看值是什么。

Master is the value in php.ini - if its not 5000 then the wrong php ini file has been edited, or you need to restart apache master是php.ini中的值-如果不是5000则错误的php ini文件已经被编辑,或者需要重启apache

Local is the value being used - if its different to the master value, then its been overwritten by apache Local 是正在使用的值 - 如果它与主值不同,则它被 apache 覆盖

In which case, check .htaccess and the conf files in the apache directories eg etc/apache2/在这种情况下,检查 .htaccess 和 apache 目录中的 conf 文件,例如etc/apache2/

If the local value is correct - 5000 - then its been changed by code in the Moodle directory somewhere.如果本地值是正确的——5000——那么它被 Moodle 目录某处的代码改变了。 Maybe check config.php or search the code for max_input_vars也许检查config.php或搜索max_input_vars的代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM