diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php
index d4c1efcb25..56067e266e 100644
--- a/phpgwapi/inc/functions.inc.php
+++ b/phpgwapi/inc/functions.inc.php
@@ -21,12 +21,17 @@
error_reporting(E_ALL & ~E_NOTICE);
magic_quotes_runtime(false);
-
- if (!function_exists('version_compare'))//version_compare() is only available in PHP4.1+
+
+ $egw_min_php_version = '4.3';
+ if (!function_exists('version_compare') || version_compare(PHP_VERSION,$egw_min_php_version) < 0) //version_compare() is only available in PHP4.1+
{
- echo 'eGroupWare requires PHP 4.1 or greater.
';
- echo 'Please contact your System Administrator';
- exit;
+ die("eGroupWare requires PHP $egw_min_php_version or greater.
Please contact your System Administrator to upgrade PHP!");
+ }
+ // check if eGW's pear repository is installed and prefer it over the other ones
+ if (is_dir(EGW_SERVER_ROOT.'/egw-pear'))
+ {
+ set_include_path(EGW_SERVER_ROOT.'/egw-pear'.PATH_SEPARATOR.get_include_path());
+ //echo "
include_path='".get_include_path()."'
\n"; } if (!defined('EGW_API_INC')) define('EGW_API_INC',PHPGW_API_INC); // this is to support the header upgrade