{$mod_strings['ERR_CHECKSYS_FASTCGI_LOGGING']}"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_FASTCGI'].' '.$iisVersion.' '; } if(strpos($server_software,'Microsoft-IIS') !== false) { $iis_version = ''; if(preg_match_all("/^.*\/(\d+\.?\d*)$/", $server_software, $out)) $iis_version = $out[1][0]; $check_iis_version_result = check_iis_version($iis_version); if($check_iis_version_result == -1) { installLog($mod_strings['ERR_CHECKSYS_IIS_INVALID_VER'].' '.$iis_version); $iisVersion = "{$mod_strings['ERR_CHECKSYS_IIS_INVALID_VER']} {$iis_version}"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_IISVER'].' '.$iisVersion.' '; } else if(php_sapi_name() != 'cgi-fcgi') { installLog($mod_strings['ERR_CHECKSYS_FASTCGI'].' '.$iis_version); $iisVersion = "{$mod_strings['ERR_CHECKSYS_FASTCGI']}"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_FASTCGI'].' '.$iisVersion.' '; } else if(ini_get('fastcgi.logging') != '0') { installLog($mod_strings['ERR_CHECKSYS_FASTCGI_LOGGING'].' '.$iis_version); $iisVersion = "{$mod_strings['ERR_CHECKSYS_FASTCGI_LOGGING']}"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_FASTCGI'].' '.$iisVersion.' '; } } // PHP VERSION $php_version = constant('PHP_VERSION'); $check_php_version_result = check_php_version($php_version); if($check_php_version_result == -1) { installLog($mod_strings['ERR_CHECKSYS_PHP_INVALID_VER'].' '.$php_version); $phpVersion = "{$mod_strings['ERR_CHECKSYS_PHP_INVALID_VER']} {$php_version} )"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_PHPVER'].' '.$phpVersion.' '; } //Php Backward compatibility checks if(ini_get("zend.ze1_compatibility_mode")) { installLog($mod_strings['LBL_BACKWARD_COMPATIBILITY_ON'].' '.'Php Backward Compatibility'); $phpCompatibility = "{$mod_strings['LBL_BACKWARD_COMPATIBILITY_ON']}"; $error_found = true; $error_txt .= ' Php Backward Compatibility '.$phpCompatibility.' '; } // database and connect if (!empty($_REQUEST['setup_db_type'])) $_SESSION['setup_db_type'] = $_REQUEST['setup_db_type']; $drivers = DBManagerFactory::getDbDrivers(); if( empty($drivers) ){ $db_name = $mod_strings['LBL_DB_UNAVAILABLE']; installLog("ERROR:: {$mod_strings['LBL_CHECKSYS_DB_SUPPORT_NOT_AVAILABLE']}"); $dbStatus = "{$mod_strings['LBL_CHECKSYS_DB_SUPPORT_NOT_AVAILABLE']}"; $error_found = true; $error_txt .= ' '.$db_name.' '.$dbStatus.' '; } // XML Parsing if(!function_exists('xml_parser_create')) { $xmlStatus = "{$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}"; installLog("ERROR:: {$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}"); $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_XML'].' '.$xmlStatus.' '; }else{ installLog("XML Parsing Support Found"); } // mbstrings if(!function_exists('mb_strlen')) { $mbstringStatus = "{$mod_strings['ERR_CHECKSYS_MBSTRING']}"; installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_MBSTRING']}"); $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_MBSTRING'].' '.$mbstringStatus.' '; }else{ installLog("MBString Support Found"); } // zip if(!class_exists('ZipArchive')) { $zipStatus = "{$mod_strings['ERR_CHECKSYS_ZIP']}"; installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_ZIP']}"); }else{ installLog("ZIP Support Found"); } // config.php if(file_exists('./config.php') && (!(make_writable('./config.php')) || !(is_writable('./config.php')))) { installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}"); $configStatus = "{$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_CONFIG'].' '.$configStatus.' '; } // config_override.php if(file_exists('./config_override.php') && (!(make_writable('./config_override.php')) || !(is_writable('./config_override.php')))) { installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE']}"); $configStatus = "{$mod_strings['ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE']}"; $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_OVERRIDE_CONFIG'].' '.$configStatus.' '; } // custom dir if(!make_writable('./custom')) { $customStatus = "{$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}"; installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}"); $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_CUSTOM'].' '.$customStatus.' '; }else{ installLog("/custom directory and subdirectory check passed"); } // cache dir $cache_files[] = ''; $cache_files[] = 'images'; $cache_files[] = 'layout'; $cache_files[] = 'pdf'; $cache_files[] = 'xml'; $cache_files[] = 'include/javascript'; $filelist = ''; foreach($cache_files as $c_file) { $dirname = sugar_cached($c_file); $ok = false; if ((is_dir($dirname)) || @sugar_mkdir($dirname,0555)) // set permissions to restrictive - use make_writable to change in a standard way to the required permissions { $ok = make_writable($dirname); } if (!$ok) { $filelist .= '
'.getcwd()."/$dirname"; } } if (strlen($filelist)>0) { $error_found = true; installLog("ERROR:: Some subdirectories in cache subfolder were not read/writeable:"); installLog($filelist); $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_CACHE'].' '.$mod_strings['ERR_CHECKSYS_FILES_NOT_WRITABLE'].' '.$mod_strings['LBL_CHECKSYS_FIX_FILES'].''.$filelist. ' '; }else{ installLog("cache directory and subdirectory check passed"); } // check modules dir $_SESSION['unwriteable_module_files'] = array(); //if(!$writeableFiles['ret_val']) { $passed_write = recursive_make_writable('./modules'); if (isset($_SESSION['unwriteable_module_files']['failed']) && $_SESSION['unwriteable_module_files']['failed']){ $passed_write = false; } if(!$passed_write) { $moduleStatus = "{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}"; installLog("ERROR:: Module directories and the files under them are not writeable."); $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_MODULE'].' '.$moduleStatus.' '; //list which module directories are not writeable, if there are less than 10 $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_FIX_MODULE_FILES'].''; foreach($_SESSION['unwriteable_module_files'] as $key=>$file){ if($key !='.' && $key != 'failed'){ $error_txt .='
'.$file; } } $error_txt .= ' '; }else{ installLog("/module directory and subdirectory check passed"); } // check upload dir if (!make_writable('./upload')) { $uploadStatus = "{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}"; installLog("ERROR: Upload directory is not writable."); $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_UPLOAD'].' '.$uploadStatus.' '; } else { installLog("/upload directory check passed"); } // check zip file support if (!class_exists("ZipArchive")) { $zipStatus = "{$mod_strings['ERR_CHECKSYS_ZIP']}"; installLog("ERROR: Zip support not found."); $error_found = true; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_ZIP'].' '.$zipStatus.' '; } else { installLog("/zip check passed"); } // check PCRE version if (defined('PCRE_VERSION')) { if (version_compare(PCRE_VERSION, '7.0') < 0) { installLog("ERROR: PCRE Version is less than 7.0."); $error_found = true; $pcreStatus = "{$mod_strings['ERR_CHECKSYS_PCRE_VER']}"; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_PCRE'].' '.$pcreStatus.' '; } else { installLog("PCRE version check passed"); } } else { installLog("ERROR: PCRE not found."); $error_found = true; $pcreStatus = "{$mod_strings['ERR_CHECKSYS_PCRE']}"; $error_txt .= ' '.$mod_strings['LBL_CHECKSYS_PCRE'].' '.$pcreStatus.' '; } $customSystemChecks = installerHook('additionalCustomSystemChecks'); if($customSystemChecks != 'undefined'){ if($customSystemChecks['error_found'] == true){ $error_found = true; } if(!empty($customSystemChecks['error_txt'])){ $error_txt .= $customSystemChecks['error_txt']; } } // PHP.ini $phpIniLocation = get_cfg_var("cfg_file_path"); installLog("php.ini location found. {$phpIniLocation}"); // disable form if error found if($error_found){ installLog("Outputting HTML for System check"); installLog("Errors were found *************"); $disabled = $error_found ? 'disabled="disabled"' : ''; $help_url = get_help_button_url(); /////////////////////////////////////////////////////////////////////////////// //// BEGIN PAGE OUTPUT $out =<< {$mod_strings['LBL_CHECKSYS_TITLE']} SugarCRM
{$mod_strings['LBL_HELP']}

{$mod_strings['ERR_CHECKSYS']}

$error_txt
{$mod_strings['LBL_CHECKSYS_COMPONENT']} {$mod_strings['LBL_CHECKSYS_STATUS']}
{$mod_strings['LBL_CHECKSYS_PHP_INI']}
{$phpIniLocation}


EOQ; return $out; }else{ installLog("Outputting HTML for System check"); installLog("No Errors were found *************"); return 'passed'; } } //// END PAGEOUTPUT /////////////////////////////////////////////////////////////////////////////// ?>