How to change the value of a PHP setting?

There are two ways to change the value of a PHP setting: through the Hostlantern' 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 Hostlantern' 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 Addbutton. 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 hostingaccount at Hostlantern. We offer the best PHP hosting and our support team is ready to assist you with any PHP questions/problems you may have.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Does Hostlantern support PHP HTTP Authorization?

Hostlantern supports the PHP HTTP Authorization and in order to enable it you need to add the...

Is PHP Safe Mode turned Off on Hostlantern’s servers

PHP Safe Mode is by default turned off for all PHP versions available on Hostlantern servers....

How to enable zlib compression manually for PHP scripts

PHP Zlib module allows you to transparently read and write gzip compressed files. Thus it is used...

What is SourceGuardian and how to use it?

SourceGuardian is commercial software which allows you to securely encode, compile and encrypt...

How to install Smarty Template Engine

Follow the steps below to install Smarty Template Engine on your hosting account: Download the...