How to set the PHP register_globals directive in my .htaccess file

I tried php_flag register_globals off or register_globals off
and after it in phpinfo(); I could not find register_globals
What’s wrong with what I’m doing?

Hi @donetsk!

This facility has been turned off since PHP 5.4.0.

Please lower your PHP version and try again: cPanel > Settings > General > Change PHP version > 5.2

1 Like

@donetsk As said above,

Downgrade to php version 5.2 or 5.3, then only can use “register_globals”.

You should read this too.
http://php.net/manual/en/security.globals.php

I’m using version 5.6 Current version: PHP 5.6 , but this does not affect the register_globals in any way, at least I do not see any changes in phpinfo ();

Perhaps the path for the file .htaccess is not correct?
files.000webhost.com/public_html/.htaccess

Oh no, I want to prohibit the use of register_globals for protection against hackers

@donetsk [quote=“donetsk, post:5, topic:70287”]
Oh no, I want to prohibit the use of register_globals for protection against hackers
[/quote]

Then you can simply upgrade your php version to 5.4 or above from Settings – General.

1 Like

Perhaps the path for the file .htaccess is not correct?
files.000webhost.com/public_html/.htaccess

It will not work. PHP team choosed to disable it. Please read this for more information.

Your only choice is to lower your PHP to < 5.4

Please look a little higher. Current version: PHP 5.6

Thanx.
In version 7 too?

No, it will not work on PHP 7. Only versions below 5.4