cancel
Showing results for 
Search instead for 
Did you mean: 

how do I change php.ini to set register_globals = off?

stuck
Rising Star
Posts: 141
Thanks: 19
Registered: ‎21-05-2009

how do I change php.ini to set register_globals = off?

I know, I know, if I have to ask a question like this I probably shouldn't be playing with CGI stuff but even so, humour me...
When I first tried to install zenphoto (an image gallery) I was told:
Error!
PHP Register globals presents a security risk to any PHP application. See Using Register Globals. Change your PHP.ini settings to register_globals = off. Click here to acknowledge that you wish to ignore this issue. It will then become a warning.

So as requested I clicked here to acknowledge the issue.  The installer then finished and I have a working zenphoto gallery.  However, it seems prudent to revisit the cause of the warning and actually fix the issue but I don't know where to start.
Any suggestions please, preferably in Dummies Guide type language.
Thanks,
stuck
2 REPLIES 2
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: how do I change php.ini to set register_globals = off?

User php.ini files are not supported on the new server. To turn off register_globals and magic_quotes_gpc you need to add the following lines to .htaccess in /public. The third line provides a suitable default timezone setting to keep PHP happy.

php_flag magic_quotes_gpc 0
php_flag register_globals 0
php_value date.timezone 'Europe/London'

David
David
stuck
Rising Star
Posts: 141
Thanks: 19
Registered: ‎21-05-2009

Re: how do I change php.ini to set register_globals = off?

Quote from: spraxyt
...add the following lines to .htaccess in /public.

Ta, that seems to have done the trick.
stuck