Modifying PHP Directives

Bolts are precisely tuned for performance, with optimized hardware, software, and network settings. Some Bolt settings may be more modest for PHP usage than other providers. Our PHP settings are perfectly optimized for most websites and applications, ensuring smooth and hassle-free performance.

In general, we don’t recommend changing these directives, as our Bolts are optimized for speed, and changes may affect the performance of your website. However, sometimes, you may need to modify a PHP directive due to WordPress plugin or theme requirements.

Remember that this will only change how PHP functions for visitors to your site. If you invoke PHP through any other means, e.g., SSH or cron jobs, default PHP directives will be used.

To view the current PHP Directives, create a new PHP file called 12345.php with the following content:

<?php

phpinfo(4); 

?>

Upload it to your website’s web root and visit the following page in a browser: example.com/12345.php.

Customising PHP Directives Using .user.ini

Head over to your ~/site/public directory. From there, you can modify PHP directives using the .user.ini file.

upload_max_filesize = 200M

post_max_size = 200M

max_input_vars = 2000

max_execution_time = 120

Explanation:

  • upload_max_filesize = 200M
    • Sets the maximum upload file size to 200 megabytes.
  • post_max_size = 200M
    • Sets the maximum size of POST data that PHP will accept to 200 megabytes.
  • max_input_vars = 2000
    • Limits the number of input variables to 2000.
  • max_execution_time = 120
    • Limits the number of input variables to 2000.

Please refer to the official documentation for a complete list of all configurable PHP directives.

Remember that this will only change how PHP functions for visitors to your site. If you invoke PHP through any other means, e.g., SSH or cron jobs, default PHP directives will be used.


And as always, should you have any additional questions please don’t hesitate to contact our support chat at servebolt.com!