I have installed phalcon via:

sudo apt update
sudo apt upgrade
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql -u root -p
 mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
 mysql> GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
 mysql> exit
sudo apt install -y php7.4
sudo apt install php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-xml
sudo apt install php-cli unzip
sudo apt install git
sudo apt install curl
sudo apt install php7.4-mysql
sudo apt install php-pear
sudo apt install php7.4-psr
sudo apt install php7.4-dev
sudo apt install gcc
sudo apt install libpcre3-dev
sudo pecl channel-update pecl.php.net
sudo pecl install phalcon
sudo echo 'extension=phalcon.so' | sudo tee -a /etc/php/7.4/mods-available/phalcon.ini
sudo ln -s -T /etc/php/7.4/mods-available/phalcon.ini /etc/php/7.4/apache2/conf.d/20-phalcon.ini

But still I can't see phalcon in phpinfo when I start php builtin server.

If I edit php.ini (from cli and apache2) with extension=phalcon.so; how the message from pecl compiler sais, the issue is not solved.

How to fix this?


I needed to run also:

sudo ln -s -T /etc/php/7.4/mods-available/phalcon.ini /etc/php/7.4/cli/conf.d/20-phalcon.ini

In this case I did not edit php.ini in anyway, the php extensions being autoloaded if they are already installed.

The phalcon extension needs additional setup to be autoloaded, for both apache2 and cli.

UPDATE. At the time of this edit there is no package for ubuntu/focal in: https://packagecloud.io/app/phalcon/stable/search?dist=ubuntu&filter=all&page=45&q=phalcon

So i uninstalled the previously installed version of phalcon with: sudo pecl uninstall phalco

And reinstalled the newer version with

cd ~
git clone --depth=1 "git://github.com/phalcon/cphalcon.git"
cd cphalcon/build
sudo ./install
  • I guess phpenmod is better command than ln
    – booota
    Nov 2 '20 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.