shell_exec magento-check.php failure

General discussion on Zend Server for IBM System i
Post Reply
kent_zacharias
Posts: 22
Joined: Mon May 09, 2011 8:05 pm

shell_exec magento-check.php failure

Post by kent_zacharias » Wed May 25, 2011 2:31 pm

How do I know if my Zend Server for IBM i server is compatible with Magento?

In order to run Magento your server needs to meet some basic software requirements. For a complete list of system requirements please reference the System Requirements page.

You can test your server for compatibility by following these simple steps:

Download the magento-check file to your computer and unzip it.
Upload the extracted magento-check.php file to the Magento directory on your server
In your browser navigate to this page:

magento/magento-check.php

(Please insert the proper path to where ever you put the magento-check.php file.)






<?
extension_check(array(
'curl',
'dom',
'gd',
'hash',
'iconv',
'mcrypt',
'pcre',
'pdo',
'pdo_mysql',
'simplexml'
));

function extension_check($extensions) {
$fail = '';
$pass = '';

if(version_compare(phpversion(), '5.2.0', '<')) {
$fail .= '<li>You need<strong> PHP 5.2.0</strong> (or greater)</li>';
}
else {
$pass .='<li>You have<strong> PHP 5.2.0</strong> (or greater)</li>';
}

if(!ini_get('safe_mode')) {
$pass .='<li>Safe Mode is <strong>off</strong></li>';
preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);

if(version_compare($version[0], '4.1.20', '<')) {
$fail .= '<li>You need<strong> MySQL 4.1.20</strong> (or greater)</li>';
}
else {
$pass .='<li>You pass have<strong> MySQL 4.1.20</strong> (or greater)</li>';
}
}
else { $fail .= '<li>Safe Mode is <strong>on</strong></li>'; }

foreach($extensions as $extension) {
if(!extension_loaded($extension)) {
$fail .= '<li> You are missing the <strong>'.$extension.'</strong> extension</li>';
}
else{ $pass .= '<li>You have the <strong>'.$extension.'</strong> extension</li>';
}
}

if($fail) {
echo '<p><strong>Your server does not meet the following requirements in order to install Magento.</strong>';
echo '<br>The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento:';
echo '<ul>'.$fail.'</ul></p>';
echo 'The following requirements were successfully met:';
echo '<ul>'.$pass.'</ul>';
} else {
echo '<p><strong>Congratulations!</strong> Your server meets the requirements for Magento.</p>';
echo '<ul>'.$pass.'</ul>';

}
}
?>

erich_hieden
Posts: 393
Joined: Tue Jul 07, 2009 9:01 am

Re: shell_exec magento-check.php failure

Post by erich_hieden » Wed May 25, 2011 4:37 pm

What's the response you get from magent-check.php?

kent_zacharias
Posts: 22
Joined: Mon May 09, 2011 8:05 pm

Re: shell_exec magento-check.php failure

Post by kent_zacharias » Wed May 25, 2011 9:44 pm

version information displayed via phpMyAdmin = Your PHP MySQL library version 5.0.45 differs from your MySQL server version 5.1.50.


results of running magento-check.php script:

Your server does not meet the following requirements in order to install Magento.
The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento:

You need MySQL 4.1.20 (or greater)

The following requirements were successfully met:

You have PHP 5.2.0 (or greater)
Safe Mode is off
You have the curl extension
You have the dom extension
You have the gd extension
You have the hash extension
You have the iconv extension
You have the mcrypt extension
You have the pcre extension
You have the pdo extension
You have the pdo_mysql extension
You have the simplexml extension

User avatar
kentatzend
Posts: 1778
Joined: Thu Dec 11, 2008 1:08 pm

Re: shell_exec magento-check.php failure

Post by kentatzend » Wed May 25, 2011 10:57 pm

Magneto does seem to run on Zend Server on i as we use it as one of our test cases but ... the real people to ask for an official answer are Magento.

kent_zacharias
Posts: 22
Joined: Mon May 09, 2011 8:05 pm

Re: shell_exec magento-check.php failure

Post by kent_zacharias » Thu May 26, 2011 12:09 am

Thank you Kenta,

Does the magento-check.php function correctly upon your test servers?


And, I posted the question directly to Magento yesterday (May 24, 2011).

timclark2000
Posts: 71
Joined: Fri May 01, 2009 8:19 pm

Re: shell_exec magento-check.php failure

Post by timclark2000 » Thu May 26, 2011 9:48 pm

If I were a betting man, I'd bet that the problem is that the mysql client program is not in the PATH of the shell that is invoked with shell_exec.

Most other OSes will have the mysql client locatable from PATH, and thus invoking an unqualified 'mysql' will work elsewhere. But on IBM i I believe neither the Zend installer nor the MySQL installer update the PATH to point to the mysql installation. Consequently, an unqualified invocation of 'mysql' won't work.

All this means is that the magento-check.php won't give the correct results on IBM i. But Magento should, since you apparently do have MySQL installed.

erich_hieden
Posts: 393
Joined: Tue Jul 07, 2009 9:01 am

Re: shell_exec magento-check.php failure

Post by erich_hieden » Fri May 27, 2011 8:09 am

Just in addition to Tim's answer, which is by the way what I think too, to solve the problem. I think you installed MySQL coming with ZendServer and since I'm running a slightly different setup here I can't check the correct paths. But you should find the mysql binary in either /QOpenSys/usr/local/mysql/mysql/bin or in /usr/local/mysql/mysql/bin or the likes. To allow the magento-check script to find the binary you have to make a symbolic link to it from a folder that's on the include path.

i.e.
ln -s /QOpenSys/usr/local/mysql/mysql/bin/mysql /QOpenSys/bin/mysql

First path is the actual position of the binary, so you might need to change that.
Second path is the position of link, you should either use /QOpenSys/bin/mysql or /usr/bin/mysql here. (I'd select depending on the position of the binary)

Regards

kent_zacharias
Posts: 22
Joined: Mon May 09, 2011 8:05 pm

Re: shell_exec magento-check.php failure

Post by kent_zacharias » Thu Jun 23, 2011 8:30 pm

Thank you Tim, and thank you Erich:

V5R4M0 - PHP version 5.3.3, Zend Server Version 5.0.4. magento-check.php functions correctly with following created symbolic link:

ln -s /usr/local/mysql/bin/mysql /QOpenSys/bin/mysql


Community Edition V1510 of Magento functions correctly using MySql Socket connection /var/tmp/mysql.sock
(instead of coding localhost or URL during installation).

Post Reply