简体   繁体   中英

Phalcon failed install on mac m1

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!!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM