Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Debian

How to Fix “pecl: command not found” on Linux

By Freedom251 Team · · 9 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Linux prints pecl: command not found, either the PECL executable is not installed or it is installed in a directory your shell does not search. On Debian and Ubuntu, install the php-pear package; Fedora and RHEL-family systems also provide it as php-pear. If the package is already present, locate PEAR’s binary directory, add it to PATH, refresh the shell command cache, and then verify with pecl version.

The commands below separate those two causes before changing anything. They also cover PHP-version mismatches, installing an extension after PECL is working, and the current recommendation to use PIE for new extension installations.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the error actually means

PECL is the command-line installer for PHP extensions. The Debian pecl(1) documentation describes the command as the tool used to install PECL extensions, while PEAR documentation expects both pear and pecl to be callable from a shell. When the shell reports that the command cannot be found, it has not resolved an executable named pecl through the directories in your PATH.

There are two common causes:

  • The provider package is missing. On the main Debian, Ubuntu, Fedora, and RHEL-family packaging routes, that provider is named php-pear.
  • The executable exists but is outside PATH. PEAR can place its binaries in a PEAR-specific bin directory. PEAR’s own guidance says that directory must be included in PATH.

This is different from an error such as “cannot open shared object file” or a PHP interpreter warning. Those messages mean the shell did find pecl and the problem has moved to PHP, libraries, permissions, or the extension build.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Identify the distribution and the PHP CLI first

Run these commands in the same shell where the failure occurs:

  1. cat /etc/os-release — identifies the distribution and release family.
  2. php -v — shows whether a PHP command-line interpreter is installed and which version it reports.
  3. command -v php — shows the exact PHP executable selected by PATH.

Do not assume that the PHP used by a web server is the same binary selected by your shell. A distribution package, a manually installed PHP tree, and a version-managed installation can put separate interpreters and extension directories on one machine. PECL must be associated with the PHP installation you intend to extend.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check whether any PECL executable is visible

Use both lookup forms:

command -v pecl
type -a pecl

If both commands return nothing, the current shell cannot see an executable. If they print a path, the original failure may have come from a different shell, a script with a restricted PATH, or a stale command lookup cache.

Ask the package database where the file should be

On Debian or Ubuntu, after (or even before) installation, query the package contents with:

dpkg -L php-pear | grep '/pecl$'

On Fedora or a RHEL-family distribution, use:

rpm -ql php-pear | grep '/pecl$'

A returned path proves that the package owns a pecl file. An empty result can mean the package is not installed, the package name differs in a derivative distribution, or the installed package does not contain the expected executable.

Install the provider on Debian or Ubuntu

For the standard distribution PHP packages, install PEAR and PECL with:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo apt update
sudo apt install php-pear

The Debian package documentation identifies php-pear as the provider of pecl. The update step refreshes local package indexes; it does not install a second PHP version by itself.

Confirm that the package supplied the command

After installation, run:

dpkg -L php-pear | grep '/pecl$'
command -v pecl
pecl version

The first command should show the installed file, the second should print the path selected by the shell, and the third should print PEAR/PECL and PHP information. If the first command shows a path but command -v pecl remains blank, this is a PATH problem rather than a missing package.

When the Debian package and PHP do not match

Distributor-supplied PHP may require PEAR to be installed separately, and a machine can also contain more than one PHP installation. Compare the result of command -v php with the PHP version shown by pecl version. If those point to different installation trees or incompatible versions, install the PEAR package from the same distribution source as the PHP CLI you plan to use, or adjust your shell so that the intended PHP and PECL pair is selected.

Install the provider on Fedora and RHEL-family systems

Fedora packaging records the relationship between php-pear and PECL module registration. Install the release’s package with its normal package manager; on current Fedora and RHEL-family systems that is commonly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo dnf install php-pear

On an older release that still uses the legacy command, the equivalent package operation is:

sudo yum install php-pear

Use the package manager supported by your release rather than mixing repositories from another version.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Verify ownership and shell visibility

rpm -ql php-pear | grep '/pecl$'
command -v pecl
pecl version

If rpm -ql lists a PECL executable but the shell does not find it, follow the PATH procedure in the next section. If pecl version reports a PHP interpreter or shared-library error, the command is installed; continue with the PHP-alignment checks instead of reinstalling it repeatedly.

Compiling extensions requires development components

PECL does more than copy a script: the PHP manual explains that it downloads extension source, compiles it, and installs the resulting shared object. If an installation reaches a compiler or header-file failure, add the development package that matches the selected PHP version and the distribution’s compiler/toolchain packages. Keep those development components aligned with the PHP CLI reported by php -v; a development package for another PHP stream can produce an extension that the active interpreter cannot load.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fix a PECL executable that is missing from PATH

When the package database shows a file but lookup fails, first find the directory portion of the returned path. For example, if the package query shows a path ending in /bin/pecl, the directory to add is the parent bin directory, not the executable itself.

Test the directory for the current shell only

Temporarily prepend the directory to PATH (replace the example with the directory found on your system):

export PATH="/path/to/pear/bin:$PATH"
command -v pecl
pecl version

Prepending gives that directory priority for this shell. If the command now works, you have confirmed the diagnosis without changing login files.

Make the change persistent

Add the export line to the startup file used by your shell, such as ~/.profile for login environments or ~/.bashrc for interactive Bash sessions:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
export PATH="/path/to/pear/bin:$PATH"

Open a new shell, or source the file explicitly, then check again:

 . ~/.profile
command -v pecl

Use the file that your environment actually reads. A graphical terminal, an SSH login, a cron job, and a web-server service can each receive a different PATH. Adding the directory to your interactive profile will not automatically change a service account’s environment.

Refresh Bash’s command cache

Bash can remember a failed or previous lookup. Run:

hash -r

Then retry command -v pecl. Starting a new shell has the same practical effect. This step is harmless even when the real issue was a missing package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check for multiple copies

type -a pecl lists every matching command visible through the current PATH. Multiple copies can belong to different PHP installations. Select the one whose PEAR and PHP versions match the interpreter you intend to use; otherwise an extension may be compiled into a directory that your web application never loads.

Verify the repaired installation

Use this short verification sequence in order:

  1. command -v pecl — confirms that the shell resolves a concrete executable.
  2. pecl version — confirms that the executable can start PHP and its PEAR libraries.
  3. pecl list — displays PECL-managed extensions known to that installation.

Interpret the results as separate checkpoints. A blank result from command -v is still a shell or PATH issue. A PHP interpreter or library error from pecl version means the executable was found but cannot run correctly. A successful version command followed by an empty or short list is not a failure; it can simply mean that no PECL extensions have been installed yet.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Install an extension after PECL works

The PHP manual documents the basic form:

pecl install extname

Replace extname with the extension’s PECL name. PECL downloads the source, compiles it, and installs an extname.so shared object into PHP’s extension directory. Compilation can prompt for options or fail if the matching development headers and toolchain are absent.

Enable the module for the correct PHP SAPI

Installing the shared object does not necessarily make PHP load it. Add the appropriate extension directive to the php.ini used by the target SAPI, or place it in that SAPI’s conf.d configuration directory. The command-line interface and a web server can read different configuration trees, so identify the one serving your application rather than editing an unrelated file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After changing web-server configuration, restart the applicable web service so it reloads PHP. A command-line script may only need a fresh process; a long-running web worker will continue using its old module set until it is restarted.

Verify loading, not just installation

Run pecl list to confirm PECL’s package record, then test the PHP SAPI that matters to you. If the command-line PHP sees the extension but the website does not, inspect the web SAPI’s configuration and restart state. If neither SAPI loads it, check the extension path, the PHP version used for compilation, and any loader error shown by PHP.

PECL’s status and the PIE migration path

The current PHP manual and the PECL homepage state that PECL is deprecated. They identify PIE (PHP Installer for Extensions) as the replacement recommended for installing new extensions. This status does not remove pecl from existing distribution packages, so fixing a command-not-found error remains a valid maintenance task for systems that still depend on PEAR/PECL.

When continuing with PECL is reasonable

  • You are maintaining an existing deployment or build script that explicitly invokes pecl.
  • Your distribution provides a supported php-pear package and the extension is known to work with the selected PHP version.
  • You need to reproduce an established environment while planning a later migration.

When to plan a PIE-based installation

  • You are designing a new extension-installation workflow rather than repairing legacy automation.
  • You want to follow the PHP project’s current recommendation instead of adding new PECL dependencies.
  • Your extension or deployment documentation already targets PIE and you can test the resulting PHP configuration.

Migration is a separate decision from repairing PATH. First make the existing command deterministic if you need it for current systems; then evaluate PIE for new installations and update automation deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the right fix: package, PATH, or migration

Situation Evidence Action Trade-off
Provider package absent command -v pecl is blank and the package-file query finds no executable Install php-pear with the distribution package manager Uses the distribution’s PHP and PEAR versions; alignment is usually simplest
Executable outside PATH dpkg -L or rpm -ql lists pecl, but shell lookup is blank Add PEAR’s bin directory to PATH, run hash -r, and open a new shell Preserves the existing installation but requires consistent environment setup
PHP or library mismatch pecl version finds the command but fails while starting PHP Compare command -v php, php -v, and PECL’s reported PHP; use matching packages May require choosing one PHP installation or adjusting package streams
New extension workflow No legacy requirement to keep PECL Evaluate PIE, the PHP project’s recommended replacement Requires updating scripts and validating the new installation path

Troubleshooting branches for persistent failures

The package installs, but pecl is still not found

  1. Run the package-file query again and copy the complete path that ends in /pecl.
  2. Check whether its parent directory appears in echo "$PATH".
  3. Export the corrected path temporarily and run hash -r.
  4. Persist the export in the startup file used by the affected shell, then start a new shell.

If this works interactively but not from automation, inspect the automation user’s environment separately; user profile files are not guaranteed to be loaded for services or scheduled jobs.

pecl version reports a PHP interpreter or library error

Stop treating this as a command lookup problem. Compare the PHP executable selected by command -v php with the installation that supplied PEAR. Multiple PHP trees can leave a valid-looking pecl script pointing at libraries that are absent or incompatible. Reinstall or realign the distribution packages so the CLI PHP, PEAR, and development files belong to the same version family.

An extension installs but the application cannot use it

Check which SAPI the application runs, place the enablement directive in that SAPI’s configuration, and restart the corresponding web service. A successful PECL build only establishes that a shared object was created; it does not prove that every PHP process loads it.

Copy-and-run checklist

  1. cat /etc/os-release
  2. php -v
  3. command -v php
  4. command -v pecl and type -a pecl
  5. Install php-pear with apt, dnf, or the package manager for your release.
  6. Locate the file with dpkg -L php-pear | grep '/pecl$' or rpm -ql php-pear | grep '/pecl$'.
  7. Add its parent PEAR bin directory to PATH if necessary, then run hash -r.
  8. Confirm with pecl version and pecl list.
  9. For an extension, run pecl install extname, enable it in the correct PHP configuration, and restart the relevant web service.
  10. For new workflows, assess PIE instead of introducing additional PECL usage.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DebianFedoraLinuxPEARPECLPHPRHELTroubleshootingUbuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.