[case CPANEL-12822,case CPANEL-13105] phpMyAdmin max_input_vars error

rarod

Active Member
Apr 20, 2017
36
2
8
Spain
cPanel Access Level
Root Administrator
I am getting this error message when I try to export a database in phpMyAdmin:

>Warning: a form on this page has more than 1000 fields. On submission, some of the fields might be ignored, due to PHP's max_input_vars configuration.

System info:
cPanel & WHM 64.0 (build 13)
phpMyAdmin Version information: 4.6.6
EasyApache 4
CloudLinux release 7.3

In WHM 62.0 (build 21) phpMyAdmin 4.0.10.18 this was working ok.

I tried changing max_input_vars in various php.ini but I get the same error.

Any ideas?
 

ChrisI

Technical Analyst II
Mar 24, 2014
67
12
83
cPanel Access Level
Root Administrator
Hello,

The php.ini for phpmyadmin should be this one:

/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini

Do you still receive the same error if you modify that one?

Thanks!
 

rarod

Active Member
Apr 20, 2017
36
2
8
Spain
cPanel Access Level
Root Administrator
I changed max_input_vars to 10000 in /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini:
  • Is working as expected if I open it from WHM->SQL Services->phpMyAdmin: I get no errors.
  • If I open phpMyAdmin from a cPanel user account I get the same error: max_input_vars is 1000.
Thanks.
 

ChrisI

Technical Analyst II
Mar 24, 2014
67
12
83
cPanel Access Level
Root Administrator
I tested this out on my test server and found that raising the max_input_vars in this file resolves the error when exporting a database that has more than 1000 tables.

/usr/local/cpanel/3rdparty/etc/php.ini

Does changing it there solve the issue for you as well?

Thanks!
 

ChrisI

Technical Analyst II
Mar 24, 2014
67
12
83
cPanel Access Level
Root Administrator
If you are using Cloudlinux and cagefs, you may also need to update cagefs to load the new value with this command.

cagefsctl --force-update

If that doesn't work, you may need to rebuild the cagefs with this command.

cagefsctl --reinit

thanks!
 

rarod

Active Member
Apr 20, 2017
36
2
8
Spain
cPanel Access Level
Root Administrator
Tryied with "cagefsctl --force-update" and "cagefsctl --reinit". Still the same.

I made a "ps aux | grep user6517" while loading phpMyAdmin and I got this:

user6517 665209 7.0 0.0 241536 19292 ? S 09:46 0:00 /usr/local/cpanel/3rdparty/php/56/bin/php-cgi /usr/local/cpanel/base/3rdparty/phpMyAdmin/navigation.php

Is php-cgi using this php.inis?
 

QuentinC

Member
Jan 10, 2013
10
1
3
cPanel Access Level
DataCenter Provider
Hi All !

Here my process:

nano /usr/local/cpanel/3rdparty/etc/php.ini
---EDIT--
max_input_vars = 10000
----
/usr/local/cpanel/bin/install_php_inis
/scripts/restartsrv_cpanel_php_fpm

Best regards!
 

rarod

Active Member
Apr 20, 2017
36
2
8
Spain
cPanel Access Level
Root Administrator
Hi All !

Here my process:

nano /usr/local/cpanel/3rdparty/etc/php.ini
---EDIT--
max_input_vars = 10000
----
/usr/local/cpanel/bin/install_php_inis
/scripts/restartsrv_cpanel_php_fpm

Best regards!
This workerd for me too.

Thanks QuentinC!

Is this php.ini change persistent in cPanel updates?
 
Last edited by a moderator:

rarod

Active Member
Apr 20, 2017
36
2
8
Spain
cPanel Access Level
Root Administrator
In a internal cPanel ticket I got this:

Changes to /usr/local/cpanel/3rdparty/etc/php.ini will persist but will always need the following run afterward.
/usr/local/cpanel/bin/install_php_inis
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

To update, internal case CPANEL-12822 is open to determine how to best address the issue where databases with more than 1000 tables can't be exported in phpMyAdmin because the default max_input_vars setting is too low. I'll update this thread with more information on the status of this case as it becomes available. In the meantime, the workaround is to manually increase the value in the /usr/local/cpanel/3rdparty/etc/php.ini file, and then run the following commands:

Code:
/usr/local/cpanel/bin/install_php_inis
/scripts/restartsrv_cpanel_php_fpm
Thank you.
 

Dhaupin

Active Member
Jan 3, 2014
41
4
8
cPanel Access Level
Root Administrator
This workerd for me too.

Thanks QuentinC!

Is this php.ini change persistent in cPanel updates?
Changes there don't persist. Cpanel updated yesterday and wiped out the edits I made to usr/local/cpanel/3rdparty/etc/php.ini (which is a symlink to /usr/local/cpanel/3rdparty/php/56/etc/php.ini). This happened on 3 different servers.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Changes there don't persist. Cpanel updated yesterday and wiped out the edits I made to usr/local/cpanel/3rdparty/etc/php.ini (which is a symlink to /usr/local/cpanel/3rdparty/php/56/etc/php.ini). This happened on 3 different servers.
Hello,

As a temporary workaround, you could setup a custom bash script that replaces the max_input_vars value and then setup a hook to automatically run that custom bash script after each cPanel update. EX:

Code:
mkdir -p /root/custom/
touch /root/custom/postupcp.sh
chmod 0755 /root/custom/postupcp.sh
vi /root/custom/postupcp.sh
When editing this file, add a line such as this:

Code:
replace "; max_input_vars = 1000" "max_input_vars = 2000" -- /usr/local/cpanel/3rdparty/etc/php.ini ; /usr/local/cpanel/bin/install_php_inis ; /scripts/restartsrv_cpanel_php_fpm
Replace "2000" with the new value you'd like to set. Then, to have this script execute automatically after each cPanel update, run this command:

Code:
/usr/local/cpanel/bin/manage_hooks add script /root/custom/postupcp.sh --manual --category System --event upcp --stage post
This will ensure the custom value is preserved through cPanel updates.

Note: Ensure to remove this custom script using the following commands once we publish a resolution for this issue:

Code:
rm /root/custom/postupcp.sh
/usr/local/cpanel/bin/manage_hooks delete script /root/custom/postupcp.sh --manual --category System --event upcp --stage post
Thank you.
 

Dhaupin

Active Member
Jan 3, 2014
41
4
8
cPanel Access Level
Root Administrator
Thanks Michael. In case folks don't wanna set up scripts, hooks, and crons, here is a function you can run from root for an on-demand fix. In this example 6000 is the value of max_input_vars written to ini's:

Code:
# whm-max-input 6000
To enable it, put this in /root/.bashrc and run command ". /root/.bashrc" to load into session:
Code:
whm-max-input() {
    if [ -z "$1" ]; then
        vars="2000"
    else
        vars=$1
    fi

    sed -in --follow-symlinks "s/[\; ]?max_input_vars = [0-9].*/max_input_vars = ${vars}/" /usr/local/cpanel/3rdparty/etc/php.ini

    /usr/local/cpanel/bin/install_php_inis
    /scripts/restartsrv_cpanel_php_fpm
    php -v
}
Enjoy
 
  • Like
Reactions: cPanelMichael

Dhaupin

Active Member
Jan 3, 2014
41
4
8
cPanel Access Level
Root Administrator
Yikes, not sure why but lots of PMA fails now for a certain DB that didnt seem to get much larger.

I cant edit the post above, so to extend upon that max-whm function to include some other boosts as well as a way to revert it back to default: gist.github.com/dhaupin/1f7ac8c7369bc60f385430e449a611eb
 
Last edited by a moderator:

EMNE

Registered
Jul 19, 2016
1
1
3
Sloveni
cPanel Access Level
Root Administrator
I just can't understand why stuff like this can not be fixed asap (few days) by cPanel. This issue probably creates thousands of tickets for providers and the fix of default php.ini setting should take about a 30 seconds for a cPanel developer. Just setting max_input_vars to 10000 by default, would have solved all the problems. Can someone explain this logic to me please?
 
  • Like
Reactions: DomineauX

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

In my case, I had some additional steps, as the user was still getting the error. What I did was:

Modified values in:
/usr/local/cpanel/3rdparty/php/56/etc/php.ini

cagefsctl --force-update
service cpanel restart

Remove user's cpanel cache folder:
rm -rf /home/$user/.cpanel

After that, run scripts
/usr/local/cpanel/bin/install_php_inis
/scripts/restartsrv_cpanel_php_fpm

Relog into user's cPanel.

I'm running:
Cloudlinux 7 (CageFS and all)
cPanel 11.64.0.21
EasyApache 4

Regards.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

To update, the following resolutions are included with cPanel version 64.0.24:
  • Fixed case CPANEL-12822: Bump max_input_vars to 10000 for phpMyAdmin.
  • Fixed case CPANEL-13105: Ensure phpMyAdmin uses the correct ini files.
The full change log is available at:

64 Change Log - Change Logs - cPanel Documentation

Thanks!
 
  • Like
Reactions: bj3782

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

I just have a couple of questions, as this is still not solved for me. Which php.ini has the cPanel update modified? All I see is the 1000 value for max_input_vars instead of 10000:

Code:
[[email protected] php]# pwd
/usr/local/cpanel/3rdparty/php
[[email protected] php]# grep -ir "max_input_vars" .
./56/etc/php.ini.dist:; max_input_vars = 1000
./56/etc/php.ini,v:; max_input_vars = 1000
./56/etc/php.ini.bak:; max_input_vars = 1000
./56/etc/roundcube/php.ini:; max_input_vars = 1000
./56/etc/phpmyadmin/php.ini:; max_input_vars = 1000
./56/etc/phppgadmin/php.ini:; max_input_vars = 1000
./56/etc/horde/php.ini:; max_input_vars = 1000
./56/etc/php.ini:; max_input_vars = 1000
Should I look somewhere else? Do I need to update manually again or should it work by default?

Thank you.