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 .= '
You need PHP 5.2.0 (or greater)';
}
else {
$pass .='You have PHP 5.2.0 (or greater)';
}
if(!ini_get('safe_mode')) {
$pass .='Safe Mode is off';
preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);
if(version_compare($version[0], '4.1.20', '<')) {
$fail .= 'You need MySQL 4.1.20 (or greater)';
}
else {
$pass .='You have MySQL 4.1.20 (or greater)';
}
}
else { $fail .= 'Safe Mode is on'; }
foreach($extensions as $extension) {
if(!extension_loaded($extension)) {
$fail .= ' You are missing the '.$extension.' extension';
}
else{ $pass .= 'You have the '.$extension.' extension';
}
}
if($fail) {
echo 'Your server does not meet the following requirements in order to install Magento.';
echo '
The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento:';
echo '
';
echo 'The following requirements were successfully met:';
echo '';
} else {
echo 'Congratulations! Your server meets the requirements for Magento.
';
echo '';
}
}
?>