Posts Tagged ‘php.ini’
Such a global change to the php.ini config is a well known security risk and affects all other customers and isn’t something we’d consider doing. However you can set that and any other variable using the method below.
You can create your own php.ini file inside whatever sub-directory your script is in. You can then determine the exact behaviour for your PHP scripts yourself.
There’s a lot of documentation on how to use the various configuration features inside php.ini online at http://uk2.php.net/configuration.
In this case, to set “register globals” on, you can just create a file called “php.ini” in the subdirectory of your website that the script is in, simply saying:
register_globals = on
Please note: if you have enabled PHP5, you will need to call this file “php5.ini” rather than “php.ini”.
Becuase of the way in which we run PHP, you are able to customise its behaviour with php.ini files. These are plain text files (use Notepad if running Windows, TextEdit in Plain Text mode on Mac), which contain directives such as:-
memory_limit = 24M
A complete list of php.ini directives can be found here:-
-: you should only set these as per the requirements of your application as other settings may cause your scripts to malfunction or be vulnerable to attack.
If you are running PHP5, you should name this file php5.ini, for PHP4 it should be php.ini . Unless otherwise required, these should be located in the root of your hosting package (ie, above public_html).
php.ini files can be used for very fine-grained control – a PHP script will pick up the settings in the php.ini file closest to it, so you can enable functions for a single folder rather than the whole site – this is useful when running CMSes on subdomains.