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

Phalcon is no longer available via brew

To my bitter finding, phalcon is no longer available for installation/updates via brew, since the recent homebrew/php tap deprecation.

I wanted to ask, is there anything that can be done from the community side that can bring back phalcon to brew?

Well entire PHP support was deprecated by package maintainers? Phalcon is only a framework/lib for PHP. If you can't run PHP - that's the problem nr. 1 to solve.

Why don't you compile it yourself? Or use GNU/Linux in a VirtualBox or something as a dev server?

Hi Jonnathan, thanks for your reply. PHP was merged to homebrew/core so it is still normally available via brew. Only problem is that phalcon got axed along the way. Sure, compiling is always an option, but it is certainly not as much convenient as running brew update/upgrade commands. If just there were any way how to get phalcon back to brew repositories, it would be awesome.

Well, you need a maintainer for phalcon formula guys :)

Reinstalling PHP from homebrew/core in this series of articles https://getgrav.org/blog/macos-sierra-apache-upgrade-homebrew and using the instructions from https://docs.phalcon.io/en/3.3/installation Chapter "Compile Phalcon" worked for me:

brew list | grep php

brew uninstall --force php71 php71-apcu php71-gearman php71-geos php71-igbinary php71-imagick php71-intl php71-mcrypt php71-mecab php71-memcached php71-meminfo php71-mongodb php71-msgpack php71-oauth php71-opcache php71-pdo-dblib php71-pdo-pgsql php71-phalcon php71-rdkafka php71-redis php71-ssh2 php71-timezonedb php71-uuid php71-v8js php71-xdebug php71-yaml

rm -Rf /usr/local/etc/php/*

brew doctor

brew install [email protected]

git clone https://github.com/phalcon/cphalcon

cd cphalcon/build

sudo ./install

look for this line in output:

Installing shared extensions:     /usr/local/Cellar/[email protected]/7.1.16_1/pecl/20160303/

phalcon.so exists inside this directory, so your extension is available in

/usr/local/Cellar/[email protected]/7.1.16_1/pecl/20160303/phalcon.so

Create a new extension ini

vi /usr/local/etc/php/7.1/conf.d/ext-phalcon.ini

with content

[phalcon]
extension="/usr/local/Cellar/[email protected]/7.1.16_1/pecl/20160303/phalcon.so"

restart apache

sudo apachectl restart

done. Hope this saves you some nerves.

edited May '18

I was able to install the latest version of Phalcon 3.3 for PHP 7.2 with Homebrew by using the following commands:

$ brew tap tigerstrikemedia/homebrew-phalconphp
$ brew install php72-phalcon

With Phalcon installed, edit your php.ini with the path to the Homebrew built extension:

extension=/usr/local/Cellar/php72-phalcon/3.3.2/phalcon.so

Once done, restart Apache, Nginx or your application's web server.

You can verify Phalcon is installed by viewing the output of phpinfo() or by inspecting PHP interactively:

$ php -i | grep "phalcon."

Which, if successfull, would show something similar to the the following:

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

Tested using Homebrew 1.6.3, Laravel Valet 2.0.12 and PHP 7.2.5 on macOS 10.13 "High Sierra".

edited Aug '18

macOS High Sierra 10.13.6, installing php72-phalcon from tigerstrikemedia/phalconphp does not create ext-phalcon.ini even though it says it does. One has to do it manually.

This worked great for me MacOS 10.14.6 Mojave, PHP 7.2.20, Homebrew 2.1.9

I was able to install the latest version of Phalcon 3.3 for PHP 7.2 with Homebrew by using the following commands:

$ brew tap tigerstrikemedia/homebrew-phalconphp
$ brew install php72-phalcon

With Phalcon installed, edit your php.ini with the path to the Homebrew built extension:

extension=/usr/local/Cellar/php72-phalcon/3.3.2/phalcon.so

Once done, restart Apache, Nginx or your application's web server.

You can verify Phalcon is installed by viewing the output of phpinfo() or by inspecting PHP interactively:

$ php -i | grep "phalcon."

Which, if successfull, would show something similar to the the following:

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

Tested using Homebrew 1.6.3, Laravel Valet 2.0.12 and PHP 7.2.5 on macOS 10.13 "High Sierra".