We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Packages missing for Ubuntu 18.04

Hello everybody,

I'm trying to install Phalcon PHP on Ubuntu 18.04 and I need some help.

I followed the installation instructions available online and the sources file was created with the following lines:

deb https://packagecloud.io/phalcon/stable/ubuntu/ bionic main
deb-src https://packagecloud.io/phalcon/stable/ubuntu/ bionic main

Then I ran the following commands:

apt update
apt install php7.2-phalcon

but the package was not found; I tried to search any package called phalcon without success.

I searched on packagecloud to try installing the package manually but I didn't find any .deb package compiled for the bionic release.

Am I doing something wrong? Did someone encounter the same issue?

Thanks.



3.1k
edited Jun '18

Ubuntu 18.04 is not supported yet as reported on GitHub, so I decided to compile Phalcon from its sources.

These are the steps I performed, which I share hoping they can help others in my same spot.

First you need to install the required packages, clone the GitHub repo and install Phalcon (source: official docs).

sudo apt install php-dev gcc php-json
git clone --depth=1 "git://github.com/phalcon/cphalcon.git"
cd cphalcon/build
sudo ./install

If the last command completes successfully, you should see the following output (or something very similar):

Installing shared extensions:     /usr/lib/php/20170718/
Installing header files:          /usr/include/php/20170718/

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation

Then you must create the following file:

/etc/php/7.2/mods-available/phalcon.ini

with the following content:

extension=phalcon.so

Then you must create a soft link at /etc/php/7.2/cli/conf.d/50-phalcon.ini pointing to the file you just created (/etc/php/7.2/mods-available/phalcon.ini).

Then you can finally restart Apache and you are ready to go. I use Apache as web server, if you use a different one the procedure will be probably different.

Well, this must be fixed ASAP as this is LTS release.



39.2k
Accepted
answer

Implemented.

[email protected]:/# php -v
PHP 7.2.8-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jul 25 2018 10:52:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.8-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
[email protected]:/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic
[email protected]:/# curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
Detected operating system as Ubuntu/bionic.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/phalcon_stable.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
[email protected]:/# apt-cache policy php7.2-phalcon
php7.2-phalcon:
  Installed: (none)
  Candidate: 3.4.0-5+php7.2
  Version table:
     3.4.0-5+php7.2 500
        500 https://packagecloud.io/phalcon/stable/ubuntu bionic/main amd64 Packages
[email protected]:/# apt install php7.2-phalcon
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  php7.2-mysql php7.2-sqlite3 php7.2-pgsql php7.2-memcached
The following NEW packages will be installed:
  php7.2-phalcon
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,233 kB of archives.
After this operation, 5,035 kB of additional disk space will be used.
Get:1 https://packagecloud.io/phalcon/stable/ubuntu bionic/main amd64 php7.2-phalcon amd64 3.4.0-5+php7.2 [1,233 kB]
Fetched 1,233 kB in 4s (285 kB/s)         
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package php7.2-phalcon.
(Reading database ... 24205 files and directories currently installed.)
Preparing to unpack .../php7.2-phalcon_3.4.0-5+php7.2_amd64.deb ...
Unpacking php7.2-phalcon (3.4.0-5+php7.2) ...
Setting up php7.2-phalcon (3.4.0-5+php7.2) ...

Creating config file /etc/php/7.2/mods-available/phalcon.ini with new version
[email protected]:/# php -r 'echo Phalcon\Version::get() , PHP_EOL;'
3.4.0
[email protected]:/# php --ri phalcon

phalcon

Web framework delivered as a C-extension for PHP
phalcon => enabled
Author => Phalcon Team and contributors
Version => 3.4.0
Build Date => Jul 28 2018 20:05:02
Powered by Zephir => Version 0.10.10-d1b4cc68d9

Directive => Local Value => Master Value
phalcon.db.escape_identifiers => On => On
phalcon.db.force_casting => Off => Off
phalcon.orm.events => On => On
phalcon.orm.virtual_foreign_keys => On => On
phalcon.orm.column_renaming => On => On
phalcon.orm.not_null_validations => On => On
phalcon.orm.exception_on_failed_save => Off => Off
phalcon.orm.enable_literals => On => On
phalcon.orm.late_state_binding => Off => Off
phalcon.orm.enable_implicit_joins => On => On
phalcon.orm.cast_on_hydrate => Off => Off
phalcon.orm.ignore_unknown_columns => Off => Off
phalcon.orm.update_snapshot_on_save => On => On
phalcon.orm.disable_assign_setters => Off => Off