Thursday, April 12, 2012

Drupal site structure change couldn't be saved

We have a huge site structure in drupal 6. After we upgraded php 5.2.6 to 5.3.3, we got a fatal error when trying to access the site structure page:


Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 82 bytes) in .....

So we have to put this line in %drupal_home%/sites/default/settings.php:

ini_set('memory_limit', '512M');

This increased the drupal memory limit from 128M bytes to 512M bytes. Now we can see the site structure page. However, when we tried to make some changes, the changes are not saved and no error on the web page. Then we found this warning in the apache error log:

[error] [client xxx.xxx.xxx.xxx] PHP Warning:  Unknown:
Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: https://yoursite.com/menu-site-structure

So now we added this line to php.ini:

max_input_vars = 2000

This increased the max input variables from 1000 (default) to 2000, and this solved the problem.


No comments:

Post a Comment