• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP folks... need help!

When browsing to a newly added folder on the webserver, I get nothing but this:

FATAL ERROR: register_globals is disabled in php.ini, please enable it!

I found php.ini and set "register_globals = On", saved the file, and quit vi, but I keep getting the same error message.

😕 Suggestions?
 
Its telling you that the register_globals option in your php.ini file is set to 0 or false.

I'd guess that in your previous folders there was either an .htaccess file or right in the main apache config something like this:

"php_value register_globals 1"

So the quick fix is to stick a .htaccess file in that new folder with that line in it. The longer fix involves deciding if enabling register_globals is a good idea (common practice is that register_globals is *not* a good thing), and if not, fixing your php code so it doesn't depend on it. If you decide it is a good idea, then enabling it in the php.ini file means you don't have to fiddle with enabling it in multiple places.
 
It's always safer to write code that doesn't depend on register_globals being enabled especially if you are writing code that can be used by other people.
 
Originally posted by: Kilrsat
Its telling you that the register_globals option in your php.ini file is set to 0 or false.

I'd guess that in your previous folders there was either an .htaccess file or right in the main apache config something like this:

"php_value register_globals 1"

So the quick fix is to stick a .htaccess file in that new folder with that line in it. The longer fix involves deciding if enabling register_globals is a good idea (common practice is that register_globals is *not* a good thing), and if not, fixing your php code so it doesn't depend on it. If you decide it is a good idea, then enabling it in the php.ini file means you don't have to fiddle with enabling it in multiple places.

So if I just dump a .htaccess file into all the subdirectories of the directory that I'm working with, all I have to include is just the line "php_value register_globals 1" right?
 
Originally posted by: MCrusty
It's always safer to write code that doesn't depend on register_globals being enabled especially if you are writing code that can be used by other people.

Yep. I wouldn't touch anything that requires it; it shows they're either behind the times or just suck.

(and by "behind the times" I mean "register globals was already considered a generally bad thing when I was doing php ~2 years ago")
 
Originally posted by: Nik
Originally posted by: Kilrsat
Its telling you that the register_globals option in your php.ini file is set to 0 or false.

I'd guess that in your previous folders there was either an .htaccess file or right in the main apache config something like this:

"php_value register_globals 1"

So the quick fix is to stick a .htaccess file in that new folder with that line in it. The longer fix involves deciding if enabling register_globals is a good idea (common practice is that register_globals is *not* a good thing), and if not, fixing your php code so it doesn't depend on it. If you decide it is a good idea, then enabling it in the php.ini file means you don't have to fiddle with enabling it in multiple places.

So if I just dump a .htaccess file into all the subdirectories of the directory that I'm working with, all I have to include is just the line "php_value register_globals 1" right?

Should only need to put it in the root directory of the website. .htaccess cascades to subdirs automatically.
 
Back
Top