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

How to Fix: Error with installing Drush on via Ansible

Learn how to fix: Error with installing Drush on via Ansible.

Quick Answer: Try checking your system settings or restarting.

The error 'PHP Notice: Array to string conversion in /usr/share/php/PEAR/REST/13.php on line 80' occurs when trying to install Drush via Ansible. This issue affects users who have installed Pear and are attempting to use Drush.

This error is frustrating because it prevents the installation of Drush, which is a critical tool for managing Drupal sites. Fortunately, this issue can be resolved by updating Pear and re-running the Ansible task.

💡 Why You Are Getting This Error

  • The primary reason for this error is an outdated version of Pear. When Pear is not up-to-date, it may not support the latest versions of Drush, leading to installation failures.
  • Another possible cause is a corrupted or incomplete PEAR installation. In some cases, a partial installation can result in errors when trying to install Drush.

🛠️ Step-by-Step Verified Fixes

Update Pear and re-run the Ansible task

  1. Step 1: Step 1: Update Pear by running the command 'sudo apt-get update' (on Ubuntu-based systems) or 'sudo yum update' (on RHEL-based systems). This ensures that you have the latest version of PEAR installed.
  2. Step 2: Step 2: Re-run the Ansible task to install Drush. The corrected task should be: `action: command pear install drush/drush creates=/usr/bin/drush`
  3. Step 3: Step 3: Verify that Drush has been successfully installed by checking for its presence in the `/usr/bin/` directory.

Reinstall PEAR and re-run the Ansible task

  1. Step 1: Step 1: Reinstall PEAR by running the command `sudo apt-get install libpear-dev` (on Ubuntu-based systems) or `sudo yum install pear-devel` (on RHEL-based systems). This will ensure that PEAR is completely reinstalled and up-to-date.
  2. Step 2: Step 2: Re-run the Ansible task to install Drush. The corrected task should be: `action: command pear install drush/drush creates=/usr/bin/drush`
  3. Step 3: Step 3: Verify that Drush has been successfully installed by checking for its presence in the `/usr/bin/` directory.

✨ Wrapping Up

To resolve the error 'PHP Notice: Array to string conversion' when installing Drush via Ansible, try updating Pear and re-running the Ansible task. If this fails, consider reinstalling PEAR and attempting the installation again.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions