Install Pecl On

Table of Contents

Boruta.info
6 months ago

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. Seems to me that you should do yum install php-pear to get pecl on your OS, not yum install pecl. On Debian/Ubuntu with the Ondrej PHP PPA: sudo apt-get install php-pear. Improve this answer. Edited Nov 18 '20 at 9:39. William Desportes. PECL makes it easy to create shared PHP extensions. Using the » pecl command, do the following: $ pecl install extname. This will download the source for extname, compile, and install extname.so into your extensiondir. Extname.so may then be loaded via php.ini. By default, the pecl command will not install packages that are marked with the. Seems to me that you should do yum install php-pear to get pecl on your OS, not yum install pecl. On Debian/Ubuntu with the Ondrej PHP PPA: sudo apt-get install php-pear. Improve this answer. Edited Nov 18 '20 at 9:39. William Desportes. Pecl install xdebug On Apple M1 hardware, you might instead need to use: arch -x8664 sudo pecl install xdebug Warning: You should ignore any prompts to add 'extension=xdebug.so' to php.ini — this will cause problems. In some cases pecl will change the php.ini file to add a configuration line to load Xdebug.

Install Pecl On Ubuntu 18.04

I was able to run it on Ubuntu + PHP 8.0. Currently newest version 0.5.0 is not adapted to PHP 8.0, although it seems to work. You have to download the source version and compile it manually (based on https://www.php.net/manual/en/install.pecl.phpize.php), but you will probably get compilation errors. In my case, there were a few minor bugs due to the missing `;` at the end of the return statement. There were also errors related to the removal of TSRM from PHP 8, but it was enough to add macros to the `.c` files.
May be useful (adds macros to the first line of all `.c` files in the current directory):
sed -i '1s / ^ / # ifndef TSRMLS_D n #define TSRMLS_D void n #define TSRMLS_DC n #define TSRMLS_C n #define TSRMLS_CC n #define TSRMLS_FETCH () n #endif n / '* .c
  • Installation and Configuration

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. I specifically recommend these two for every PHP developer.

Download PEAR

Configure and Install PEAR

Install Pecl On

Install Pecl On Ubuntu

You should now be at a prompt to configure PEAR.

  1. Type 1 and press return.

  2. Enter:

  3. Type 4 and press return.

  4. Enter:

  5. Press return

Verify PEAR

You should be able to type:

Eventually, if you use any extensions or applications from PEAR, you may need to update PHP's include path.

Find this interesting? Let's continue the conversation on Twitter.