If you are using Nginx with PHP-FPM, you should follow these steps to ensure your changes to max_input_vars are applied correctly:
- Locate the php.ini File: Ensure you are editing the correct php.ini file. To find the location of the active php.ini file, you can create a PHP file with the following content and access it through your web server:
php
Copy code
<?php phpinfo(); ?>
Look for the Loaded Configuration File entry to find the path to the php.ini file.
- Edit the php.ini File: Open the php.ini file with a text editor and set the max_input_vars directive:
ini
Copy code
max_input_vars = 3000
- Check PHP-FPM Pool Configuration: PHP-FPM can have its own configuration that overrides settings in php.ini. Check the pool configuration files typically found in /etc/php/7.x/fpm/pool.d/. Open the pool configuration file (e.g., www.conf) and ensure there are no conflicting php_value or php_admin_value directives.
- Restart PHP-FPM and Nginx: After editing the php.ini file, you need to restart both PHP-FPM and Nginx to apply the changes:
bash
Copy code
sudo systemctl restart php7.x-fpm
sudo systemctl restart nginx
Replace php7.x-fpm with the appropriate version number of PHP-FPM you are using.
- Verify the Changes: Create a PHP file with the following content and access it through your web server to confirm the new max_input_vars value:
php
Copy code
<?php phpinfo(); ?>
Look for the max_input_vars directive in the output to ensure it reflects the new value (3000 in this case).
By following these steps, you should be able to ensure that the max_input_vars setting is correctly applied in your Nginx and PHP-FPM setup.