Mon 27 Nov 2006
Despite all the claims, phpMyAdmin will not work with register_globals=Off in php.ini
What to do?
Make sure HAVE_PHP is defined so that Apache loads the php modules as this is a requirement. The Apache manual says that
The <IfDefine test>...</IfDefine> section is used to mark directives that are conditional. The directives within an IfDefine section are only processed if the test is true. If test is false, everything between the start and end markers is ignored.
The test in the <IfDefine> section directive can be one of two forms:
* parameter-name
* !parameter-nameIn the former case, the directives between the start and end markers are only processed if the parameter named parameter-name is defined. The second format reverses the test, and only processes the directives if parameter-name is not defined. The parameter-name argument is a define as given on the httpd command line via -Dparameter-, at the time the server was started.
So we need to investigate how Apache is started. This is done by the httpd startup file in /etc/rc.d/rc2.d. This scans the installed modules listed in moduledir (/usr/lib/apache) and converts their names into arguments that httpd can use by removing MOD_ or LIB from the start and .SO from the end of any filenames and appending this to -DHAVE_. The code is shown below
-
/usr/bin/find /usr/lib/apache -type f -perm -0100 -name "*" | env -i tr '[:lower:]' '[:upper:]' | awk '{\
-
gsub(/.*\//,"");\
-
gsub(/^MOD_/,"");\
-
gsub(/^LIB/,"");\
-
gsub(/\.SO$/,"");\
-
print "-DHAVE_" $0}'
Our moduledir contains the file libphp4.so and so we therefore have HAVE_PHP4 defined which will cause Apache to load the required module.
<IfDefine HAVE_PHP>
LoadModule php_module modules/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module modules/libphp4.so
</IfDefine>
<IfDefine HAVE_PHP>
AddModule mod_php.c
</IfDefine>
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
</IfDefine>
<IfDefine HAVE_PHP4>
AddModule mod_php4.c
</IfDefine>
So the problem must lie in our phpMyadmin configuration file config.inc.php. Problem solved! Definition for $cfg['PmaAbsoluteUri'] needs to be in double quotes:
$cfg['PmaAbsoluteUri'] = "http://" . $_SERVER['HTTP_HOST'] . "/path/to/phpMyAdmin/";

