register_globals is enabled
evilgenius - May 7, 2008 - 19:06
register_globals is enabled how will I disable it? I'm getting an error upon installation and I won't be able to continue unless I disable register_globals. Please advice.
register_globals is enabled how will I disable it? I'm getting an error upon installation and I won't be able to continue unless I disable register_globals. Please advice.
This is so FRUSTRATING! Its
This is so FRUSTRATING! Its just installing and I'm already encountering this friggin problems!
I've searched the forum and saw several issues regarding this. Followed their advice but nothing works!!
- I created a php.ini with "register_globals = off" and put in my public_html directory. DID NOT WORK.
- Edited the .htaccess file with "AddHandler application/x-httpd-php5 .php". STILL DID NOT WORK. (where EXACTLY in the .htaccess file should I put this?)
- Also did "php_flag register_globals off" in my htaccess file. STILL NOTHING.
My PHP version is 5.2.5
Let me know what else should I do.
Have you been restarting Aapche?
Any change to php.ini or Apache config files (except .htaccess) requires you to restart Apache before it takes effect.
Note: php.ini files usually don't go in your public_html directory unless you are on a host who has specifically set that up.
If this is on a hosted server, you should look through the hosting providers docs and/or ask their support how to make that change.
Or if you run the server (or if this is on your PC) and want specific advice about what you need to change, you'll need to specify more about what platform and/or distro and web server version etc you are using. There is no single universal situation for everyone - default configurations for different platforms may change where things go, and (for example) different Linux distros arrange Apache config files differently.
As this is purely a PHP question for a specific platform or Apache distribution, you might also want to ask in the support forums/lists for that platform or distribution eg WAMP, MAMP, XAMP, Ubuntu, Fedora etc
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
I'm sorry but how can I
I'm sorry but how can I restart Apache?
With regards to the php.ini tell me if I did this right. I cannot find any existing php.ini on my hosting account so what I did was create it using notepad and renamed its extension to .ini (from .txt). Put register_globals = off as one liner on the file then placed the .ini file in my public_html directory. The instructions here in the forum says to put it in my "root" folder. Drupal is installed in that folder so I guess it's my root folder.
Please help coz I'm about to lose my patience. Thanks.
So you are on a hosted server?
Restarting Apache isn't something you can do on a shared hosting server.
If none of the standard ways work, you need to ask your host (or look it up in their support docs) how to turn it off.
If your host doesn't have docs telling you how, or won't let you, or won't listen to you, then you need to find another host.
Take that as a useful indication of how good a host they are and how they will treat you when you have other issues you need to sort out. Finding out how good their support is now is much better than finding out later when your popular site is down and you need their help to fix it. In my opinion not being able to turn off register_globals (which is the default setting anyway) also indicates that your host doesn't care much about security.
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
Thanks Anton for your help.
Thanks Anton for your help. Will take your advice on this. All my frustrations were channeling on Drupal where in fact the real culprit is actually my host. I was just really about to switch to Joomla. Thanks again!
The host replied and advised
The host replied and advised me the same thing to create php.ini on my public_html directory. I did that again, but still nothing is working.
One thing I noticed though is that when I load my phpinfo.php file its indicating there that register_globals is off both in master and local value field. But when I go to the PHP Configuration the value is set to on.
What is going on?!
I also notice that the Memory_limit increased from 32MB to 128mb when I add the php.ini.
IIRC the php.ini file needs
IIRC the php.ini file needs to be in the same folder as index.php - it is not applied recursively to subdirectories.
HTH,
gpk
----
www.alexoria.co.uk
It is in the same folder as
It is in the same folder as index.php.
OK got it, so you have
OK got it, so you have index.php in public_html :)
What happens if you run a very simple script test.php say:
<?phpprint ini_get('register_globals');
?>
With phpinfo(), is the value of register_globals reported as the string 'Off' ?
gpk
----
www.alexoria.co.uk
It doesn't work. When I go
It doesn't work. When I go to test.php it doesn't do anything it only returns blank page. What is the script supposed to do? However, the value in the phpinfo is still set to 'Off'. But when I go to CPANEL - SOFTWARE/SERVICES - PHP CONFIGURATION the value is 'On' in the register_globals. I don't know if it has something to do with each other but I suspect this is what its causing it.
My host insist that the php.ini would oughtta solve my problem. Its about 24 hours since I encounter this annoyance but still it has yet to resolve! Please help!
If phpinfo() is being run in
If phpinfo() is being run in a script in the same directory as your php.ini then it is correctly picking up the new setting. cPanel will not be picking up your custom php.ini and is showing the system default value.
The script probably is working ... try this now:
<?php
$rg= ini_get('register_globals');
print gettype($rg) . ', ';
// and now, assuming it's a string ...
print strlen($rg) . ', ' . bin2hex($rg);
print ', register_globals is ';
$rg2 = trim($rg);
if (!empty($rg2) && strtolower($rg2) != 'off') {
print 'ON';
}
else {
print 'OFF';
}
?>
gpk
----
www.alexoria.co.uk
cPanel would not read your
cPanel would not read your php.ini. This is a central set of files outside the webroot of individual users and gets its values from the master php.ini file that is loaded when Apache loads. What you are doing is overriding these master values in your own corner of the server. It doesn't affect anyone else on the server.
Also tried to add
Also tried to add memory_limit in the php.ini file. STILL NOTHING IS WORKING!
That wouldn't make any
That wouldn't make any different to the register_globals problem ...
gpk
----
www.alexoria.co.uk
register_globals problem on installation
As per 1and1.com support, the following helped me:
...
While the PHP developers have done their utmost to ensure compatibility, we
cannot guarantee that PHP4 scripts will function 100% correctly under PHP5.
Please note that in contrast to PHP4, the default for the variable
RegisterGlobals is "off".
By default Apache uses PHP4 for .php extension. If you don't want to rename
all your scripts to .php5 you can do the following:
Create a .htaccess file and place the following line AddType x-mapp-php5 .php in it.
...
I just added the above line in the default .htaccess and installation continued without a hitch.
Heya guys! Thanks SO MUCH
Heya guys! Thanks SO MUCH for the help. This problem has been resolved now by my host. I don't know what exactly did they do. I've just had it so I gave them access to my account and told them to fix it.
Topic's close now.. Thanks again!