1、 Background

Some time ago, the MAC system was reloaded, and some extensions of PHP were lost. Yesterday, I needed to debug a project developed by swote. I found that PHP in the command line was brought by the system. If you install the extension, it is very inconvenient. You need to manually download the source code of swoole, then compile the source code of swoole and configure it by yourself. The whole process is very cumbersome;

I remember that it is very convenient to install swoole by using the PHP installed with brew and then using PECL. So I unloaded the PHP I brought with, and then used brew to install again, and installed PECL. After installing the swoole extension through PECL, I recorded the installation process for the next time

This guide will contain information regarding installing 'yaml' using PECL on a cPanel server. To install a PHP module you use the PECL command, EasyApache 4 includes multiple versions of PHP, so there is a different command for each PHP version as an example here is the PECL location for PHP 7.2, PHP 7.3, and PHP 8.0. Oct 16, 2012 The following instructions install PEAR and PECL on Mac OS X under /usr/local/.PECL is bundled with PEAR. So this is as simple as installing PEAR on Mac OS X. PEAR is PHP's Package Repository and makes it easy to download and install PHP tools like PHPUnit and XDebug.

  1. I am using ubuntu 18.04 docker image. And install apt install php and i want to install xdebug but there is no pecl. How to install pecl?
  2. Finally refresh system package cache and install php 8.0 packages via command: sudo apt update sudo apt install php8.0-fpm libapache2-mod-php8.0 php8.0-mysql php8.0-xml. There are also many other packages available, e.g., php8.0-amqp, php8.0-apcu, php8.0-memcache, php8.0-memcached, and more. Just add or remove package names after “sudo apt.
  3. Installing a PHP extension on Windows On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled extension is the easiest and preferred way. To load an extension, you need to have it available as a '.dll' file on your system.

2、 Operation summary

  1. Uninstall your own software
  2. Re install software
  3. Verify the swote extension

3、 Uninstall your own software

Previously, when the MAC system was upgraded to 10.15 Catalina, I found that when I uninstalled PHP, I was promptedRead-only file systemI found a solution on the Internet. It needs to shut down the systemsipBefore you can delete some files, execute the following command

After the command is executed, the returned information is shown in the figure below

In the figure above, we can see that the command has been executed successfully. Then we can delete the PHP. First, we need to find out the location of the PHP. Check the PHP location command as shown below

After the command is executed, the returned information is shown in the figure below
In the above figure, you can see that a PHP path is returned. We can delete it. The command to delete the PHP is shown below

After the command is executed, the returned information is shown in the figure below
You can see it in the picture abovermThe command does not prompt an exception, indicating that the removal of PHP has been successful.

In order to prevent us from using brew to install the old version of PHP, we also try to uninstall the version of PHP installed by brew. The command to uninstall the old version of PHP installed by brew is shown below

This step is not necessary, but in order to prevent unexpected problems during the installation process, you can uninstall it if you can. You can also jump to the PECL installation step without uninstalling

After the command is executed, the returned information is shown in the figure below
As you can see in the figure above, you have successfully uninstalled the version of PHP that brew installed

4、 Re install

Pecl

We use the brew command to install the new version of PHP. Brew itself needs to be installed, but I believe you have already installed it. The command to install PHP with brew is shown below

After the command is executed, the returned information is shown in the figure below

In the figure above, we can see that the installed version of PHP is 7.3, and the installation location of PHP is also shown, indicating that we have successfully installed.

Next, we need to install PECL. First, we need to download the PECL installation package from PHP’s official website, and execute the command as shown below

After the command is executed, the returned information is shown in the figure below

In the above figure, you can see that the installation package has been downloaded. Next, we can use PHP to execute the installation package. The execution command is as follows

After the command is executed, the returned information is shown in the figure below

In the figure above, we can see that PECL has been installed. Now we can use PECL to install the tool. The execution command is as follows

This command will have a compilation process, and the execution time is a little long. The information pdf free download. After the command is executed, the returned information is shown in the figure below

In the above figure, you can see that the implementation has been successful, and the droole extension is automatically installed into the PHP extension directory and added to the configuration file.

5、 Verify the swote extension

After the installation of droole is completed, we can verify the availability of the installation in the following two ways. First, check the extension module command of PHP installation to see whether the droole is displayed. The execution command is shown as follows

After the command is executed, the returned information is shown in the figure below

In the above figure, you can see that the swoole module is installed in PHP. Then we will find a project that depends on the swoole. I have a project developed with laravel. Once we come to the swote, the startup command is as follows

After the command is executed, the returned information is shown in the figure below

In the figure above, you can see the version information of PHP and spool, which shows that the whole installation process has been completed

Install pecl on windows

6、 Book recommendation

If you are more interested in the author’s practical articles, you can pay attention to the author’s Publishing House “PHP web security development practice”, which has been sold on various platforms. The cover is shown in the figure below

Author: Tang Qingsong

How To Install Pecl

Wechat: songboy8888

Install Pecl On Mac

Date: December 3, 2019