View Full Version : PHP Register_Globals
sub-spaced
February 7th, 2004, 01:51 PM
Hi Everyone,
I have a slight problem with my current version of PHP, the register_globals is set to off and I do not know how to change it to on. I do not know Unix commands and for some reason the php.ini file is in not in the usr/local directory but in etc/ directory and is named php.ini.default.
Can anybody help me, I can't find anything on the internet on how to change the file with the unix commands.
Please help.
Thanks
Darren
Gnomo
February 7th, 2004, 11:03 PM
I've had similar problems trying to set the include path. I tried renaming the php.ini.default to php.ini ... didn't work. I tried editing the php.ini.default file ... didn't work. Finally I did find that you can change ini settings at runtime.
So, while it isn't a solution, you might be able to use the ini_set('register_globals', TRUE) as a work around until someone else can give us both the answer.
uoba
February 8th, 2004, 05:35 PM
First of all. Do a test PHP file from your server with just this code in (you may know this, you may not):
<?php phpinfo(); ?>
Save the file on your web server and open it from your browser. It'll tell you all the info about your PHP install. The sixth row down should tell you where your php.ini file resides on your machine.
Let me know if it's there and whether you've found it. We can take it from there.
btoth
February 9th, 2004, 08:37 PM
If the php.ini file is not located in the directory specified, you can copy and move the php.ini.default file and rename in php.ini and it will look for that file instead if I'm remembering correctly. Then you can just Go>Go To Folder... and open it from there to edit it with a proper text editor if you're not comfortable with the Unix terminal.
If I'm wrong about the ini thing, someone correct me. :)
My php.ini.default is located in /etc and I made a php.ini in /etc also that has my custom settings and is verified using the <?php phpinfo(); ?> function.
uoba
February 10th, 2004, 04:10 AM
Yep, this is fine to do (I think this is the purpose of the php.ini.default file anyway).
andehlu
February 15th, 2004, 06:21 PM
Also, doing things this way is inherently more secure than the old way .. don't know how, but just is, OK! ;)
It ensures that variables are being passed via thier proper action and not just some wanker plugging URL vars trying to use GET to execute your scripts...
dlloyd
February 21st, 2004, 10:04 AM
To clarify: turning registar_globals to OFF means that you can put anything you like after the URL, but unless you retrieve it with a $_GET['']; it doesn't get executed into the script.
If registar_globals is ON, then anything after the URL is automatically included. For example, some idiot could try to poison your MySQL query by putting something like index.php?query=[insert something here], assuming your MySQL query was contained in a variable called $query. The danger is that this idiot could go and download an open source program you were using and know all the possible variables he could poison.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by
vBSEO 3.3.2