PDA

View Full Version : phpMyAdmin & RegisterGlobals



nsc
11-28-2004, 11:23 PM
Hi,

I use phpMyAdmin as installed through the Site Manager 2.0.

Yesterday I tried to turn off the register_globals option of PHP by editing my php.ini. The reason is because I have read that letting this option enabled is a security risk.

After I did that I noticed that phpMyAdmin wasn't working correctly. I edited again php.ini and re-enabled register_globals. Now phpMyAdmin works ok, but I would like to find a way to make it work with register_globals off.

Any ideas?

jalal
11-29-2004, 01:09 AM
phpmyadmin need register_globals turned on.

However, you don't need it on for the whole site, you can just turn it on for the directory where phpmyadmin lives, using an .htaccess file.

If you really want to have phpmyadmin work with register_globals turned off, then you will probably have to rewrite the script yourself.

HTH

LWC
01-27-2005, 01:47 AM
Actually, I found out it's pretty easy to make PHPMyAdmin be register_globals free!

Turns out that the mess is caused simply because PHPMyAdmin, which uses frames, insists on using the HTML command "base href" and bases it on a global outdated PHP parameter.

So all you have to do is edit (if you have WH 2.0) the file
/var/www/html/plugins/PhpMyAdmin/config.inc.php

Then just change the old, now useless, $cfg['PmaAbsoluteUri'] into
$cfg['PmaAbsoluteUri'] = "http://" . $_SERVER['HTTP_HOST'] . "/plugins/PhpMyAdmin";

Now register_globals can be off for good!
Who knew it's that easy?

See, $_SERVER['HTTP_HOST'] is one of the "super global commands" PHP created to replace outdated commands that needed register_globals.

I informed Westhost and they promised me they'll consider using $_SERVER['HTTP_HOST'] too in the future.