Enable/Disable PHP register_globals Print

  • 609

Enable/Disable PHP register_globals
----------------------
You can learn more on what Register Globals is by using the link below:
http://us2.php.net/register_globals

For those wishing to turn on or turn off PHP register_globals, you can edit files within your account to set this setting locally. Depending on if the machine you are on is using PHPSUEXEC or not will determine which method you use.

For NON-PHPsuexec servers:
1) Using a file manager from cPanel or FTP: locate the ".htaccess" file located in each directory.
*NOTE* If you want this setting for your entire site, edit the .htaccess in public_html if not, edit the .htaccess file within the folder you want it for.

2) Once you have this file opened with an editor, add the below line onto a new line in the file:
php_flag register_globals off
(Change it to On to turn it on)

3) Save the file, and your done!

For PHPsuexec servers:
1) Using a file manager from cPanel or FTP: Create a file named "php.ini" in the directory of your choice or in "public_html" for your entire site.

2) Now open it with a text editor and add the following line:
register_globals = Off
(Change to On if you want this enabled)

3) Now save the file, and your done!

This process can be followed for many other similar php settings. Bear in mind that for a phpsuexec file, a local php.ini file only affects the directory that it's directly put in. Subdirectories are not affected.

Was this answer helpful?

« Back