Magento Connect Manager or Magento downloader shows empty page
or fails with the following error message:
Class 'Exception' not found in downloader/pearlib/php/PEAR/Frontend.php on line 91
or
Assigning the return value of new by reference is deprecated in downloader/pearlib/php/PEAR/Frontend.php on line 91
or
Warning: Parameter 3 to PEAR_Task_Replace::validateXml() expected to be a reference,
value given in downloader/pearlib/php/PEAR/PackageFile/v2/Validator.php on line 1143
It is Magento 1.3 or early Magento 1.4.0 release running on server with PHP 5.3 version.
The reason of the error message is deprecated functions used in the old Magento Pear code. To let it work the following changes can be used:
-
edit downloader/pearlib/php/PEAR/PackageFile/v2/Validator.php and changle line 1143 from
$ret = call_user_func(array($tagClass, ‘validateXml’), $this->_pf, $v, $this->_pf->_config, $save);
to
$ret = call_user_func(array($tagClass, ‘validateXml’), $this->_pf, $v, array(&$this->_pf->_config), $save);
- edit downloader/pearlib/php/PEAR/Frontend.php and change line 91 from
$obj = &new $uiclass;
to$obj = new $uiclass;
- alternatively, edit the following files:
- downloader/Maged/Pear.php
- lib/Varien/Pear.php
and change error_reporting function fromerror_reporting(E_ALL & ~E_NOTICE);
toerror_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);