Centos uses the pecl command to install the PHP extension. Enter the php extension name to install it

The Pecl command can be used to install PHP extensions, which can solve the problem in minutes. Previously, PHP extensions were installed by downloading source code and compiling and installing them. In the end, I was confused. I searched online and found that I could use the Pecl command to install it. It is so convenient! Here is how to install PHP extensions using the Pecl command. PECL is a repository for PHP extensions, which provides a directory of all known extensions and hosting facilities for downloading and developing PHP extensions.

Pecl command to install PHP extensions and solve problems in minutes

BeforeAll of them were compiled and installed by downloading the source code. In the end, I was confused and searched online to find out that I could useIt is so convenient to install it with command! Old rookies still have to keep learning.How to install.

To install PHP extensions in CentOS and Red Hat systems, you can usually use the dnf command in the software repository. However, some PHP extensions do not exist in the official software repository, and are not compatible with other software repositories. It is very convenient to use the Pecl command to install PHP extensions on the PHP official website.

PHP extension website address:https://Pecl.php.net

The website looks a bit simple, but the PHP extensions in it are all essential.

What is PECL

PECL is a repository for PHP extensions, providing a catalog of all known extensions and hosting facilities for downloading and developing PHP extensions.

PECL uses the same packaging and distribution system as its sister PEAR.

Centos uses the pecl command to install the PHP extension. Enter the php extension name to install it-1

How to use PECL commands

Example: I want to install an imagick extension

pecl install imagick

Note: Before installing the PHP extension, you need to install the main software first. The PHP extension only supports the software to be called in PHP. If the main software is not installed, then installing the PHP extension is invalid.

Centos uses the pecl command to install the PHP extension. Enter the php extension name to install it-1

After the imagick extension is installed, you also need to add "extension=imagick.so" to the php.ini file.

echo extension=imagick.so >> /etc/php.ini

Last Use php -m | grep imagickRun the command to check. If the extension is displayed normally, then the installation is successful.

Centos uses the pecl command to install the PHP extension. Enter the php extension name to install it-1

Isn't it easy to install PHP extensions using the pecl command?

How to use PECL command:

pecl command parameter php extension name

build Build the extension from C source code
bundle unpacks a Pecl package
channel-add Add a channel
channel-alias specifies an alias for the channel name
channel-delete Delete a channel from the list
channel-discover Initialize a Channel from its server
channel-info Retrieve channel information
channel-login connects to and authenticates to a remote channel server
channel-logout Log out from the remote channel server
channel-update Update an existing channel
clear-cache Clear the Web service cache
config-create creates a default configuration file
config-get displays a configuration
config-help Display information about a setting
config-set Change settings
config-show shows all settings
convert Convert package.xml 1.0 format to package.xml 2.0 format
cvsdiff Runs "cvs diff" on all files in a package
cvstag Set CVS release tag
download Download package
download-all Download every available package from the default channel
info Display information about a package
install installation package
list List the installed packages in the default channel
list-all List all packages
list-channels List available channels
list-files List files in installed packages
list-upgrades List available upgrades
login connects to a remote server and authenticates [deprecated in favor of channel login]
logout Log out from the remote server [deprecated in favor of channel-logout]
makerpm builds an RPM spec file from a PEAR package
package build package
package-dependencies Show package dependencies
package-validate Verify package consistency
pickle builds PECL packages
remote-info Information about remote packages
remote-list List remote packages
run-scripts Runs post-install scripts bundled with the package
run-tests Run regression tests
search Search the remote package database
shell-test Shell script test
sign Sign a package distribution file
svntag sets SVN release tags
uninstall Uninstall package
update-channels Update channel list
upgrade upgrade package
upgrade-all Upgrade all packages [calling upgrade without parameters is deprecated]
Usage: pecl [options] command [command options] <参数>
Type "pecl help options" to list all options.
Type "pecl help shortcuts" to list all command shortcuts.
Type "pecl help version" or "pecl version" to list the version information.
Type "pecl help " to get help for the specified command.

score

Leave a Reply

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