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.
When installing the same PECL extension for multiple PHP versions, PECL may report a duplicate installation.
Solution:
1. Install the extension
<code>sudo pecl -d php_suffix=8.0 install <package></code>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
<code>sudo pecl uninstall -r <package></code>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.
php中文网 Courses
php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.