If you’re trying to install the MongoDB extension for PHP using PECL and encounter the following error:
install failed
You’re not alone. This is a common issue, especially on older systems or when PECL’s channel list is outdated.
Cause of the Error
This error typically occurs when:
The PECL channel list on your server is outdated or corrupted.
There are network issues preventing PECL from fetching the latest package list.
You’re on a deprecated OS or PHP version where PECL defaults no longer align with current repository paths.
Quick Solution
You can often fix this issue by updating the PECL channel first:
sudo pecl channel-update pecl.php.net
This command forces PECL to refresh its channel list, downloading the latest available package information.
After that, try installing again:
pecl install mongodb