PECL (PHP Extension Community Library) is an essential tool for PHP developers who need to install and manage extensions not included in the standard PHP distribution. While many modern Linux distributions bundle PECL with PHP, older systems like Fedora 7 often require manual installation.
Before attempting installation, verify if PECL is already available:
which pecl
pecl version
For Fedora 7, you'll need to install PHP development tools first:
yum install php-devel php-pear
This installs both the PHP development environment and PEAR (PHP Extension and Application Repository), which includes PECL.
If the standard package isn't available, try these approaches:
# Method 1: Using PEAR installer
pear install pecl
# Method 2: Manual installation from source
wget http://pear.php.net/go-pear.phar
php go-pear.phar
After installation, ensure your environment is properly set up:
export PATH=$PATH:/usr/local/pear/bin
pecl update-channels
Test your PECL installation by attempting to install a simple extension:
pecl install mailparse
If this works without errors, your PECL installation is functional.
For Fedora 7 specifically, you might encounter these problems:
# Missing dependencies
yum install gcc make autoconf
# PHP version conflicts
pecl config-set php_bin /path/to/correct/php
Keep your extensions up-to-date with:
pecl upgrade-all
pecl list-upgrades
Before diving into installation, it's crucial to understand that PECL (PHP Extension Community Library) is different from PEAR (PHP Extension and Application Repository). While PEAR handles PHP libraries, PECL specifically deals with compiled PHP extensions written in C.
Ensure you have these components installed first:
sudo yum install php-devel php-pear gcc make autoconf
The php-devel
package contains the necessary header files for compiling extensions.
On most Linux distributions including Fedora, PECL comes bundled with PEAR. To install:
sudo yum install php-pear
This will install both PEAR and PECL together.
After installation, verify it works:
pecl version
You should see output similar to:
PEAR Version: 1.10.13
PECL Version: 1.10.13
If the standard package doesn't work on older systems like Fedora 7:
Manual Installation from Source
1. Download the latest PEAR package:
wget http://pear.php.net/go-pear.phar
2. Install using PHP:
php go-pear.phar
3. Follow the interactive prompts to complete installation.
After installation, ensure your path includes PECL binaries:
export PATH=$PATH:/usr/local/pear/bin
Add this to your ~/.bashrc
for persistence.
If you encounter "command not found" after installation:
sudo ln -s /usr/bin/pecl /usr/local/bin/pecl
This creates a symbolic link if the binary isn't in your default path.
Once PECL is working, install an extension like mailparse:
sudo pecl install mailparse
Don't forget to add the extension to php.ini:
extension=mailparse.so
To keep PECL updated:
sudo pecl channel-update pecl.php.net
sudo pecl upgrade