how to install pecl on ubuntu 18.04

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?

3 Answers

I installed pecl on ubuntu 20.04 using apt install php-dev (php7.4). this may be useful.

1

I don't know much about docker. Here are my notes for installing XDebug on Ubuntu 18.04 (in HyperV VM) for PhpStorm. There may be some mistakes but this worked for me.

apt install php-xdebug
##### Ubuntu Server #####
mkdir -p /var/log/xdebug
touch /var/log/xdebug/xdebug.log
chown -R www-data:www-data /var/log/xdebug
nano /etc/php/7.2/mods-available/xdebug.ini
################################################################################################################################################################################################################
# The default value for zend_extension is enough. But if you want to change, go to /usr/lib/php/ and find latest folder with xdebug.so (in my case '20180731') and make full path to provide in zend_extension #
################################################################################################################################################################################################################
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_connect_back = 1
xdebug.idekey = PHPSTORM
xdebug.remote_log = /var/log/xdebug/xdebug.log
;zend_extension=/usr/lib/php/20180731/xdebug.so
;xdebug.remote_host = 127.0.0.1
;xdebug.remote_autostart = 1
;xdebug.remote_handler = dbgp
;xdebug.remote_mode = req
systemctl restart apache2

Run the command below to install php-pear, then you can use "pecl".

sudo apt install php-pear

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like