J
J
JackShcherbakov2018-05-30 07:28:22
PHP
JackShcherbakov, 2018-05-30 07:28:22

PhpMyAdmin. There is an error due to php_max_input_vars. How to fix?

Hello!

I have a MySQL database with several tables. Among these tables is a table that stores a list of countries. I parsed wikipedia to get an array of countries - the result was an array with a length of 51 values. I wrote a very sluggish PHP script that looped through an array and for each element made a request to the database to insert a new row:

<?php

require("modules/php/database.php");

$countries = array(/*массив со странами длиной 51*/);


foreach ($countries as $country) {
  echo $country . "<br>";
  db_add_country($country);
}

function db_add_country($country){
  $db = db_connect();
  $query = "INSERT INTO countries VALUES(NULL, ?)";
  $stmt = $db->prepare($query);
  $stmt->bind_param("s", $country);
  $stmt->execute();
}
?>


I went to PhpMyAdmin to make sure that everything went well and found this message:

5b0e2725aa3c2932242059.png

After that, I immediately began to dig on the Internet, for people the problem was solved either by reinstalling OpenServera, or by removing the sign; before input_max_vars in php.ini. In short, I did not find the answer on the Internet.

I set huge values ​​to make sure it worked. Here is the php config:

expose_php = Off
max_execution_time = 180
max_input_time = 180
;max_input_nesting_level = 64
max_input_vars = 10000000000000000000000000000000000000
memory_limit = 1536M

I saved the php.ini file, restarted OpenServer, the changes were reflected in php_info (), respectively, the configuration was changed. Then I go to PhpMyAdmin, and this message appears again. I repeated this procedure several times - nothing helped.

What else could be wrong? How can I fix this and what am I doing wrong?

Thanks in advance to everyone who helps.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexalexes, 2018-05-30
@JackShcherbakov

max_input_vars = 10000000000000000000000000000000000000

Seriously. )))) And in what data type should the environment put this value in order to check the limit later?
You experiment at least within one order, 3000 ... 5000.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question