Reputation: 359
I followed those step to install phalcon on my mac m1, my php version is 7.4.20
step1: brew tap tigerstrikemedia/homebrew-phalconphp
step2: brew install php72-phalcon
step3: add this line to php.ini
extension=/opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so
step4: php -v, shows the error
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so' (tried: /opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so (dlopen(/opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so, 9): Symbol not found: __zval_ptr_dtor
Referenced from: /opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so
Expected in: flat namespace
in /opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so), /opt/homebrew/lib/php/pecl/20190902//opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so.so (dlopen(/opt/homebrew/lib/php/pecl/20190902//opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so.so, 9): image not found)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so' (tried: /opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so (dlopen(/opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so, 9): Symbol not found: __zval_ptr_dtor
Referenced from: /opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so
Expected in: flat namespace
in /opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so), /opt/homebrew/lib/php/pecl/20190902//opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so.so (dlopen(/opt/homebrew/lib/php/pecl/20190902//opt/homebrew/Cellar/php72-phalcon/3.4.2/phalcon.so.so, 9): image not found)) in Unknown on line 0
PHP 7.4.20 (cli) (built: Jun 3 2021 19:10:14) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v7.4.20, Copyright (c), by Zend Technologies
How can I solve this problem? Thanks!!
Upvotes: 2
Views: 1238
Reputation: 97948
The "72" in "php72-phalcon" refers to PHP 7.2, but you are using PHP 7.4, so it's not going to be compatible - extensions need to be built against the correct version of PHP in order to run. The version of Phalcon it's installing (3.4.2) is also out of date, because that was the last version supported on that version of PHP.
The instructions for installing Phalcon 4.0 on a Mac are here: https://docs.phalcon.io/4.0/en/installation#macos
They refer to a different homebrew repository:
brew tap phalcon/extension https://github.com/phalcon/homebrew-tap
brew install phalcon
Upvotes: 1