Increasing PHP Variables Limit for Synology NAS

Synology NAS PHP INI
Share ThisShare on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

Editing PHP INI in Synology NAS

During the course of  WordPress development, you may find that it is necessary to tweak the default settings of PHP.ini file to increase Max_Input_Vars from 1000 to more (5000 for example).

In one such scenario, if you are using the plugin ‘Table Rate Shipping for WooCommerce‘, you will need to increase the Max_Input_Vars in order to additional shipping rates to be created. If Max_Input_Vars remains at the default settings, you will find an error ‘Action Failed. Please refresh and try again’ whenever you try to create more shipping rates after hitting the higher limit.

The plugin developer had already provided some simple instructions on how to tweak the PHP.ini settings at their support page. However things may not be so straight forward, if you are developing from a Synology NAS and you do not have any experience with CLI (Command Line Interface) environment.

  1. Do try out the various steps recommended by the plugin developer. If things work, you do not have to follow through the below procedures. To check your current Max_Input_Vars, just simply find 3rd Party Plugins that does ‘PHPInfo’. Just search for ‘PHPInfo’ during Add Plugins and install the best plugin you can find. At the time of writing, I am using Debug Info plugin.
  2. If things does not work, you will need to directly access the PHP.ini file within your Synology NAS. You will need to use a SSH Client to access the file.
  3. First, enable the SSH Service through Synology Control Panel.
Synology NAS: Enable SSH
Synology NAS: Enable SSH
  1. Second, download a suitable SSH Client. Just google for it. Window based users, you can refer to this link.
  2. Open your SSH Client and connect to your NAS, using the following settings:
    1. Host: Your NAS IP Address
    2. Port: 22
    3. UserID: root
    4. Password: Your Admin Password
  3. Once you have entered the Terminal Console, type in ” cd /etc/php  “
  4. Type ” vi php.ini”  to edit the file (Refer to this link for deeper understanding)
Synology NAS PHP INI
Synology NAS PHP INI
  1. Press ” i ”  to enter Insert Mode.
  2. Add in “max_input_vars = 5000” (You can enter any number more than 1000)
  3. Press ESC to exit Insert Mode.
  4. Type in “:x! ” to Save & Exit  (If you faced Permission Denied problems, make sure you logged in using root, not admin.)  You can type in sudo -i   to enter root mode.
  5. Close the SSH Client and go to your Synology NAS’s administrative backend and restart the server.
  6. Once rebooted, login to your WordPress backend and make sure the PHPInfo plugin is reflecting the inserted value for max_input_vars.

Ken Toh

SEO Consultant & WordPress Engineer at Thinking Notes
Ken graduated with a Master’s Degree in Information Systems from Nanyang Technological University, specializing in Human Computer Interaction and Usability Engineering. Beside WordPress development, Ken provides professional SEO consulting services to SMEs and has helped his clients improved their businesses significantly through top page ranking results. In his free time, Ken runs a top children birthday party website, which provide specialized children birthday party photography services.