Install script for phpmyadmin cannot work out PHP version

I'm trying to use the install script on a virtual server to install phpmyadmin. When you try to add it, it comes back saying

his script cannot be installed, as this virtual server does not meet its requirements : Could not work out exact PHP version

This script cannot be installed, as it requires PHP version 5.

Not really sure how to convince Virtualmin that the server is running PHP 5.

Status: 
Closed (fixed)

Comments

Howdy -- yeah, that certainly shouldn't happen, it sounds like Virtualmin is confused about something.

If you log into your server over SSH as root, what output do you see if you type this command:

rpm -qa | grep php

Also, while in the Virtualmin GUI, if you select your domain name from the drop-down on the top-left, then go into Server Configuration -> Website Options, what is the PHP Execution Mode set to? Thanks!

rpm -q -a|grep php php-pdo-5.2.11-1.el5.vmbleed php-mysql-5.2.11-1.el5.vmbleed php-gd-5.2.11-1.el5.vmbleed php-pecl-memcache-2.2.3-1.el5_2 php4-imap-4.4.8-1vm php4-ncurses-4.4.8-1vm php-common-5.2.11-1.el5.vmbleed php-cli-5.2.11-1.el5.vmbleed php-5.2.11-1.el5.vmbleed php-pgsql-5.2.11-1.el5.vmbleed php-imap-5.2.11-1.el5.vmbleed php-mbstring-5.2.11-1.el5.vmbleed php-xmlrpc-5.2.11-1.el5.vmbleed php-devel-5.2.11-1.el5.vmbleed php-pear-1.8.0-1.el5.vm php-pecl-apc-3.0.19-1.el5.vm php4-4.4.8-1vm php4-mysql-4.4.8-1vm php4-gd-4.4.8-1vm php4-domxml-4.4.8-1vm php4-devel-4.4.8-1vm php4-pear-4.4.8-1vm php-mcrypt-5.2.11-1.el5.vmbleed php-xml-5.2.11-1.el5.vmbleed wbm-php-pear-1.5-1 php-odbc-5.2.11-1.el5.vmbleed php-snmp-5.2.11-1.el5.vmbleed php4-odbc-4.4.8-1vm php4-mbstring-4.4.8-1vm php4-xmlrpc-4.4.8-1vm

As to the PHP execution mode -- this is something that I've never understood. On this server, I can set it (we're running fcgid) and the setup is correct in the httpd.conf file, and it runs under fcgid -- but if you go to LOOK at the setting for the domain, neither of the execution mode boxes is ever checked -- That is, it says to run as the domain owner, but neither CGI nor FCGID is checked in the display.

That error about being unable to work out the exact PHP version can happen if the command php-cgi -v doesn't output a version number.

If you go to Webmin -> Others -> Command Shell and run php-cgi -v , what does it output?

Well -- that's interesting.

If I run php-cgi -v from the command line logged into the server as root I get the expected

h-3.2# php-cgi -v PHP 5.2.11 (cgi-fcgi) (built: Oct 2 2009 04:34:17) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

But if I run it from Webmin as you requested I get

php-cgi -v Security Alert! The PHP CGI cannot be accessed directly.

This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.

How did you install PHP 5.2? Was it from our packages, or some other source?

It's from the vmbleed repository - I need 5.2 for a lot of the Drupal hosting I'm doing. So yeah, it's one of your packages. See answer #2 above

That's odd, on a test CentOS 5 system with the exact same packages installed phpMyAdmin installs just fine.

That error from php-cgi -v on the Command Shell page is misleading, as it is only complaining because PHP thinks it is being run from a webserver.

Try running php -v on the Command Shell instead.

Up in #4 I did it both from Webmin and from the shell -- it worked fine from the shell, returning

php-cgi -v PHP 5.2.11 (cgi-fcgi) (built: Oct 2 2009 04:34:17) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

The only things I can think of that would be different on my systems (I tried both my shared servers, and they both have the same problem).

  1. Servers are using APC PHP accelerator

  2. I'm using a hand built version of fcgid because the newer releases work a lot better than the one in your repositories. But I don't really see that either of these should be an issue here -

Also --

php -v returns -sh-3.2$ php -v PHP 5.2.11 (cli) (built: Oct 2 2009 04:37:52) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

If possible, you might want to try turning off the ARC PHP accelerator - it might be breaking the PHP output in some way when Virtualmin runs php-cgi -v

Turning off APC in production is just not an option --- these sites will just fall over and kill the server without the optimization.

Also -- I tried turning off APC on a test server -- didn't help, still fails exactly the same way.

If you like, I could login to your system and take a look - I would need root SSH access though.

Sure -- I'm doing some system maintenance right now -- as soon as I get a chance to change the root passwd and enable remote root password logins, I'll let you know.

More info - I've finally realized that this only fails on SOME domains.

Some of these sites are running Drupal with the root of the domain moved down a level from public_html -- that is, the Apache root is public_html/drupal (long story, has to do with multi-domain hosting in drupal and setting up a little forest of symlinks to accomodate this). Anyway, the install of the scripts fails on THOSE DOMAINS ONLY -- on the ones where the document root is public_html, they work fine.

And I just emailed you the RIGHT login credentials for the right server.

I wouldn't necessarily consider this a priority at this point, since I'm in the process of redoing the domains that are set up that way -- but it's a curiosity.

Changing the HTML directory shouldn't break PHP version detection .. although it may break other things.

I would be interested to know which domains you see this issue for.

Try installing phpmyadmin under, for example, capebretonguide.com -- this is one of the domains where it doesn't work, and it has a moved root directory. Also, it's one of the domains where if you break it it won't particularly be disturbing.

Ok, I see it now .. the real issue is that in the Apache config for capebretonguide.com the DocumentRoot had been set to the drupal sub-directory, but the <Directory> directive had not been changed to match. This breaks Virtualmin's ability to work out which PHP version applies for that directory.

Once I fixed your httpd.conf file, all was well. To avoid this in future, change the document directory at Server Configuration -> Website Options, as this updates all the proper config files.

Automatically closed -- issue fixed for 2 weeks with no activity.