简体   繁体   中英

max_input_vars in php.ini not updating after change

To keep it clear I'll give as much info as I can to solve this issue.

I tried importing a database today and got the message that my max_input_vars was on 1000 and it needed to be upped in php.ini .

I changed it to many numbers starting from 2000 up to 10000 . But everytime I changed it it would not update the max_input_vars and would keep giving me the same error.

I tried restarting the server and looking around the internet but could not find a fix. I hope someone here can help me out with this problem.

Three things you might have overlooked:

  1. Check phpinfo(); to make sure you're editing the right php.ini file.
  2. If you've never updated that parameter, it's probably commented out like this:
; max_input_vars = 1000

So make sure you remove this sneaky semicolon at the beginning of the line.

  1. Don't forget to restart your web server.

Please check if PHP is running as a service (for example php-fpm). In my case I needed to run:

service php-fpm reload
  1. Run phpinfo().

  2. Look at the table rows almost at the top of the page

    • "Loaded Configuration File"

    • "Scan this dir for additional .ini files"

    • "Additional .ini files parsed"

      and this one about 5 screens from the top

    • "user_ini.filename" (see manual page )

  3. Among these .ini files (specified in these rows of phpinfo() output), find containing "max_input_vars" (without quotation marks).

Think, analyze...

In my case it was a Docksal issue "Can't override php.ini..." , I created the second file of these two...

  • .docksal/etc/php/php.ini
  • .docksal/etc/php/php-fpm.conf

...and got the desired max_input_vars value!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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