Software⏱️ 3 min read📅 2026-06-11

How to Fix: PHP Fatal error: Call to undefined method PEAR::raiseErro() in /usr/share/php/PEAR/REST.php on line 165

PEAR::raiseErro() is an undefined method in PEAR version 1.10, causing a fatal error when running pear upgrade.

Quick Answer: Upgrade to PEAR version 1.11 or later to resolve the issue.

The PHP Fatal error: Call to undefined method PEAR::raiseErro() in /usr/share/php/PEAR/REST.php on line 165 occurs when attempting to upgrade the PEAR package. This error affects users who have installed PEAR and are trying to update their system.

This issue is frustrating because it prevents users from upgrading their system, which can lead to outdated software and security vulnerabilities. In this guide, we will provide two methods to resolve this issue and help you upgrade your system successfully.

🛑 Root Causes of the Error

  • The error occurs due to an incompatibility between the PEAR package version and the PHP version being used. The PEAR package version has changed over time, and some older versions of PHP may not be compatible with newer PEAR versions.
  • Another possible cause is a corrupted or incomplete installation of the PEAR package. This can happen if the installation process was interrupted or if there were issues with the package's dependencies.

🚀 How to Resolve This Issue

PEAR Package Upgrade

  1. Step 1: Open a terminal and run the command 'sudo apt-get update' to update the package list.
  2. Step 2: Run the command 'sudo apt-get install -y libpear-dev' to install the PEAR development files.
  3. Step 3: Update the PEAR package using the command 'sudo pear upgrade' to ensure you have the latest version.

Manual Configuration

  1. Step 1: Manually edit the /usr/share/php/PEAR/REST.php file to remove or comment out the line causing the error.
  2. Step 2: Update the PHP configuration to use a compatible version of PEAR. This can be done by editing the /etc/php7.4/apache2/php.ini file and setting the 'pear_path' variable to point to the correct location of the PEAR package.

🎯 Final Words

To resolve the PHP Fatal error: Call to undefined method PEAR::raiseErro() in /usr/share/php/PEAR/REST.php on line 165, you can try either upgrading the PEAR package or manually configuring your system. If you're not comfortable with manual configuration, upgrading the PEAR package is usually the recommended solution.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions