Fix PHP version (7.3 to 7.4) for Phalcon on Mac Monterey

For my own reference, I use Monterey . I already install PHP but recent update to Phalcon force me to use latest version (5.1.3 at the moment).

A few notes during update :

Repointing PHP from 7.3 to 7.4

Edit httpd.conf

sudo nano /usr/local/etc/httpd/httpd.conf

Find php7_module and change from 7.3 to 7.4

LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so

Save the file and restart Apache

Phalcon from 4.1 to 5.2.1

Install through pecl

Update

pecl channel-update pecl.php.net

Install

pecl install phalcon-5.2.1

Previous phalcon already detected from commandphp -m | grep phalcon
phalcon line

php -m | grep phalcon
PHP Warning: Module ‘phalcon’ already loaded in Unknown on line 0
Warning: Module ‘phalcon’ already loaded in Unknown on line 0
phalcon

From phpinfo page I got clue of previous phalcon php version

Additional .ini files parsed /usr/local/etc/php/7.4/conf.d/ext-opcache.ini, /usr/local/etc/php/7.4/conf.d/ext-phalcon.ini, /usr/local/etc/php/7.4/conf.d/ext-psr.ini

rm /usr/local/etc/php/7.4/conf.d/ext-phalcon.ini

sudo apachectl start

Recheck modul from command line

php -m | grep phalcon
phalcon

Phalcon 5 Devtools

Install php composer

brew install composer

mkdir /Users/alamsyahrasyid/Sites/devtools5

cd /Users/alamsyahrasyid/Sites/devtools5

composer upgrade –ignore-platform-req=ext-phalcon

 

P.S