How to Install and Uninstall PECL Extensions for Multiple PHP Versions

This article explains how to use PECL with the -d php_suffix and -r options to install and uninstall the same extension across multiple PHP versions, and also announces an online PHP training class for beginners to advanced learners.

php Courses
php Courses
php Courses
How to Install and Uninstall PECL Extensions for Multiple PHP Versions

When installing the same PECL extension for multiple PHP versions, PECL may report a duplicate installation.

Solution:

1. Install the extension

sudo pecl -d php_suffix=8.0 install <package>

The -d php_suffix= option specifies the PHP command suffix, e.g., -d php_suffix=8.0 refers to php8.0.

2. Uninstall the extension sudo pecl uninstall -r <package> Adding the -r flag prevents removal of the installed .so file.

Repeating the above steps allows successful installation of the same extension for other PHP versions.

Additionally, the article announces the 21st session of the “PHP Beginner to Expert Training Camp” online live class, covering “PHP Development Fundamentals and Practice” and “Comprehensive Practice”, with enrollment details provided.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

backend-developmentPHPcommand-linePECLExtension Installation
php Courses
Written by

php Courses

php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.