Register Globals On Off

The error message Register Globals On means that the register_globals directive is set to On in your PHP configuration file. This directive controls whether or not PHP will automatically create global variables for the contents of the EGPCS (Environment, GET, POST, Cookie, Server) variables.


Having register_globals set to On is a security risk, as it allows attackers to inject malicious code into your PHP scripts. If you receive this error, you should disable the register_globals directive in your PHP configuration file.


To disable the register_globals directive, you will need to edit your PHP configuration file. The location of this file will vary depending on your web hosting provider. Once you have found the file, you will need to find the register_globals directive and set its value to Off.


For example, if your PHP configuration file is located at /public_html/php.ini, you would add the following line to the file:

register_globals = Off

Once you have disabled the register_globals directive, you will no longer receive the error message Register Globals On.

Here are some additional details about the register_globals directive:

  • The register_globals directive is deprecated in PHP 5.3.0 and removed in PHP 5.4.0.
  • The register_globals directive is enabled by default in PHP 4.2.0 and earlier.
  • The register_globals directive can be disabled by setting its value to Off in the PHP configuration file.

If you run a script that requires php "register globals on" instead, create a php.ini file and include the following:

register_globals = 1

Save the file and upload it to the directory of the script that requires register globals on. If the script requires it in multiple directories you can upload your php.ini to those directories as well.

If that does not function for the script create or modify your .htaccess file to include the following:

php_flag register_globals On

Save the file and upload it to the directory of the script that requires register globals on.

Note: This feature is no longer supported by PHP versions 5.3 and above.


Contact Ultra for additional support.

  • 492 Users Found This Useful

Was this answer helpful?

Related Articles

Running a PHP file with a cron job

To run a PHP file from cron, use the "cron jobs" section of your control panel. Use the following...

Useful CSV to MySQL Script

The link below is a great tool we have run into for converting CSV files into MySQL format:CSV to...

Increase PHP Memory

Fatal error: Allowed memory size of xxxxxxxxx bytes exhausted (tried to allocate xxxxxxxx bytes)....

Changing your PHP version

Have you received an error regarding your PHP version? If so, you may quickly and easily change...

Internal Server Error with PHPList

PHPList produces internal server error. Checking error logs results in:Invalid command...