How to change the value of a PHP setting?

There are two ways to change the value of a PHP setting: through the SiteGround' PHP Variables Manager or by manually creating a local php.ini file and uploading it in the chosen folders.

   1. Change the value of a PHP setting through the SiteGround' PHP Variables Manager:

You can apply changes to the PHP values using our tool in cPanel. The tool can be found under:

cPanel -> PHP Variables Manager

Once you go to the specified section you can write the variable which you wish to change and press the Add button. The variable will appear below and you can choose to enable (green tick) or disable it (red cross).

After you make the necessary changes press the Save button and the changes will be saved.

The Apply changes to all sub-directories? check will allow you to add the changes to the current folder and all associated subfolders if you need such functionality to be applied.

   2. Change the value of a PHP setting through a local php.ini file:

Alternatively, you can manually apply custom PHP settings on a per-folder basis using a local php.ini file.

For example, you need register_globals set to Off in a directory. For this purpose you should log in your cPanel and go to the File Manager. There navigate to the directory where you'd like this setting applied. In this directory create a file php.ini containing:

register_globals = off

Naturally, if you'd like register_globals turned on you should specify:

register_globals = on

The above works perfectly fine with most web hosting companies, including Siteground.

However, there are two exceptions:

- some important PHP limits cannot be changed, for example memory_limit and max_execution_timeout. Setting different values than the administratively assigned will endanger the overall shared server performance.

- PHP might be compiled as an Apache module. In this case try using a .htaccess file containing:

php_value name value

For example, if you'd like to turn off register_globals you have to specify:

php_value register_globals off

Please note that you cannot change global PHP settings with a local php.ini file if you are using PHP 5.1. Also there are certain limits that are globally defined and cannot be changed per account. 

If you want to be able to use different PHP settings and PHP versions on a per-folder basis, you can sign up for a hosting account at SiteGround. We offer the best PHP hosting and our support team is ready to assist you with any PHP questions/problems you may have.


  1. Reply October 29, 2015 / 09:02 MartinSiteGround Team

    I searched php.ini file in my hosting account to see how its configured but didn't find it even with cPanel's File Manager search box. I know it's there and therefore my question is: How to make visible php.ini file in cPanel's File Manager?

    • Reply November 3, 2015 / 13:22 Ivan YordanovSiteGround Team

      You can check the location of the php.ini file that your site is currently using by creating a file with phpinfo(); content and view the section:

      Loaded Configuration File

      If there is no local php.ini file, you will be using the global one and you won't be able to open it through the File Manager. However, all of the settings can be viewed from the phpinfo(); function. Just create a .php file with random name and content:

      < ?php phpinfo(); ?>

      and open it in your browser using your domain name and the path to the file.

  2. Reply February 9, 2016 / 15:06 aljosa ( xo-projects )SiteGround Team


    post_max_size & upload_max_filesize can not be set to some bigger values than 128MB with user's php.ini, am I right? If so, how can it be done?

    Thank you!

    • Reply February 11, 2016 / 16:01 Ivan YordanovSiteGround Team

      You are right - as we have specified in the article, some values are globally defined on the shared servers and cannot be changed per account. Post_max_size and upload_max_filesize are one of these variables. You can change them on Cloud/Dedicated Servers.

  3. Reply February 27, 2016 / 16:44 CatalinSiteGround Team


    I have to change the max_execution_time to 180 and I can not find the php.ini. How can I change it for a couple of minutes?

    Best regards

    • Reply February 29, 2016 / 15:53 Ivan YordanovSiteGround Team

      You can find the variable in the PHP Variables Manager in cPanel. When you start typing in the field, there is an autocomplete option, so once you type "max_e" the max_execution_time variable will be suggested.

      However, as it is mentioned in the article, you will be able to change this variable if your account is not hosted on a shared server (but on Cloud or Dedicated Server)

* (Required)