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)

  4. Reply June 26, 2016 / 22:11 SuneSiteGround Team

    I tried to add memory_limit = 512 using the PHP Variables Manager tool.
    The tool created php.inin in public_html, and added 3 lines:

    memory_limit = 512

    Before I could see phpinfo telleing Memory_limit= 128, and after the new php.ini I have blank screen when refreshing phpinfo - and my magento frontpage just show error:
    "Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 12288 bytes) in /home/myroot/public_html/app/Mage.php on line 44"

    I deleted the php.ini, and Magento was fine again, except still only 128 memory_limit, which gives error in other situations 🙁 as in:
    "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8363 bytes) in /home/myroot/public_html/lib/Zend/Cache/Backend/File.php on line 993" and
    "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home/myroot/public_html/lib/Zend/Db/Statement/Pdo.php on line 291"

    Any other - more stabile way of changing memory_limit?

    • Reply June 29, 2016 / 13:36 Ivan StefanovSiteGround Team

      Sune, the correct syntax of the php.ini should looks like this:

      memory_limit = 512M

      On the other hand, if you're hosted on StartUp or GrowBig plan the maximum memory_limit that might be occupied by PHP execution is 256MB

  5. Reply September 6, 2016 / 18:14 IrwinSiteGround Team

    Hi, Im under growbig account, but still my wordpress site under the Avada theme gave me this error: Your current memory limit is sufficient, but if you need to import classic demo content, the required memory limit is 256MB.

    And even after i changed the memory_limit value to 256M at php.ini using cpanel file manager, I still get the same error above. How can I fix this?

    • Reply September 7, 2016 / 14:59 escalationsSiteGround Team

      Check your WordPress installation for additional memory_limits set in its files. Most commonly those are present in the wp-config.php file. If you need further assistance, contact our tech support team via the Help Desk under your user area.

* (Required)