Phalcon failed install on mac m1 - php

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

Related

PHP can not load Imagick library - PHP Startup: Unable to load dynamic library

I have High Sierra OS - Version 10.13.6
PHP Version: PHP 7.1.9
when I try to do command php -v always appear error like this:
PHP Startup: Unable to load dynamic library
'/usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/imagick.so'
- dlopen(/usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/imagick.so,
9): Library not loaded:
/usr/local/opt/imagemagick/lib/libMagickWand-7.Q16HDRI.5.dylib
Referenced from:
/usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/imagick.so
Reason: image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library
'/usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/imagick.so'
- dlopen(/usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/imagick.so,
9): Library not loaded:
/usr/local/opt/imagemagick/lib/libMagickWand-7.Q16HDRI.5.dylib
Referenced from:
/usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/imagick.so
Reason: image not found in Unknown on line 0 PHP 7.1.9 (cli) (built:
Sep 14 2017 10:05:35) ( NTS ) Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.9, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans
AFAIK, my php.ini failed to load imagick library.
I already install Imagick with brew,
there is a file imagick.so inside folder /usr/local/php5-7.1.9-20170914-100859/lib/php/extensions/no-debug-non-zts-20160303/.
I already search many sources for this issue, I found many similar issues too in StackOverflow, it seems similar to mine but still not fixed my issue.
I can still run PHP script obviously, but cannot do some manipulation image with Imagick.
Try:
sudo pecl uninstall imagick && sudo pecl install imagick
For debugging I suggest you move the dep to a folder easy to debug, such as in /User/<you>/Documents/. You can load it from the absolute path:
extention="/User/<you>/Documents/<project and check if it's a path issue.
I think that you are trying to install the dependency that is older than the current version of PHP, because you are loading the extention from php56 but you are using php71
https://stackoverflow.com/a/50529784/5893008

undefined symbol: amqp_ssl_socket_set_verify_peer in Unknown on line 0

Just updated PHP to 5.6.30 and every PHP request produces a WARNING
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/amqp.so' - /usr/lib64/php/modules/amqp.so: undefined symbol: amqp_ssl_socket_set_verify_peer in Unknown on line 0
Package php-pecl-amqp-1.8.0-1.el6.remi.5.6.x86_64 is installed and the latest version.
I use CentOS release 6.7 (Final)
I can only reproduce with librabbitmq-last version 0.7.1
# yum --enablerepo=remi-php56 install php-pecl-amqp
...
Installed:
php-pecl-amqp.x86_64 0:1.8.0-1.el6.remi.5.6
Dependency Installed:
librabbitmq-last.x86_64 0:0.8.0-1.el6.remi
# php -v
PHP 5.6.30 (cli) (built: Jan 19 2017 08:09:42)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
# php -m | grep amqp
amqp
So ensure you have latest librabbitmq-last version 0.8.0 (in "remi-safe" repository, which is required and enabled by default)
P.S. indeed, this symbol was not in 0.7.x, but was introduced in 0.8.0

Class 'AMQPConnection' not found. AMQP and PHP api version conflict

After one of PHP updates (ubuntu) I got an error Class 'AMQPConnection' not found in my application.
I reinstalled latest stable version (1.7.1) of amqp via pecl
sudo pecl uninstall amqp
sudo pecl install amqp
It asks me:
downloading amqp-1.7.1.tgz ...
Starting to download amqp-1.7.1.tgz (79,905 bytes)
..................done: 79,905 bytes
18 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Set the path to librabbitmq install prefix [autodetect] :
When I choose one of the variants - builds fails, error always like
configure: error: Please reinstall the librabbitmq distribution itself or (re)install librabbitmq development package if it available in your system
ERROR: `/tmp/pear/temp/amqp/configure --with-librabbitmq-dir=20121113' failed
If I choose autodetect, installation proccessed successfully.
Then I add extension=amqp.so into php.ini and get an error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/amqp.so' - /usr/lib/php5/20131226/amqp.so: cannot open shared object file: No such file or directory in Unknown on line 0
I found amqp.so via
locate amqp.so
It display
/usr/lib/php5/20121212/amqp.so
Then I change extension=amqp.so to the full path /usr/lib/php5/20121212/amqp.so
And I get very interesting error
PHP Warning: PHP Startup: amqp: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
As I understand, PHP compiled with version newest than Amqp.
But it is the latest amqp library version.
Pecl shows:
Package Stable/(Latest) Local
amqp 1.7.1 (stable) 1.7.1 Communicate with any AMQP compliant server
PHP version is 5.6.4
PHP 5.6.4-4ubuntu6 (cli) (built: Apr 17 2015 15:47:51)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend
Technologies
with Xdebug v2.2.6, Copyright (c) 2002-2014, by Derick Rethans

Running Composer with MAMP: Unable to load dynamic library mcrypt.so

I am attempting to get composer running on my Mac and using MAMP. I installed composer using
sudo curl -sS https://getcomposer.org/installer | phpmamp
So, in .bash_profile, I've added the following alias
alias phpmamp='/Applications/MAMP/bin/php/php5.5.14/bin/php'
After installing, I also moved composer.phar to /usr/local/bin/composer
Now I try to run composer and I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so' - dlopen(/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so, 9): Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
Referenced from: /usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so
Reason: image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so' - dlopen(/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so, 9): Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
Referenced from: /usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so
Reason: image not found in Unknown on line 0
??+?%
Here's my php version info:
PHP 5.5.14 (cli) (built: Jul 25 2014 17:02:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
I've tried adding the following to my bash_profile with no luck/difference:
PATH=/Applications/MAMP/bin/php/php5.5.17/bin:$PATH
You're trying to load PHP 5.3 libraries into a PHP 5.5 installation. You need to install a PHP 5.5 version of mcrypt. If you're using Homebrew to manage your PHP install (which you should), brew install php55-mcrypt will do the trick.

PHP extension "mcrypt" must be loaded but no PHP source for my version?

I'm trying to install Magento but getting the error above. I've scoured the web for how to create the mcrypt extension (http://www.oldapps.com/php_programming_language.php?old_php=12364), but without luck because I can't find my version of PHP to install it (php 5.3.26).
I added mcrypt to the extensions list but now I just get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so, 9): image not found in Unknown on line 0
PHP 5.3.26 (cli) (built: Jul 7 2013 19:05:08)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
Scour the web for the source, try here: http://www.oldapps.com/php_programming_language.php?old_php=12364

Categories