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.so error

Hello! phalcon and psr installed and operational.

but when you use the command in a terminal, for example:

composer require avto-dev/b2b-api-php

an error:

PHP Warning: PHP Startup: Unable to load dynamic library 'phalcon.so' (tried: /usr/lib64/php/modules/phalcon.so (/usr/lib64/php/modules/phalcon.so: undefined symbol: php_json_decode_ex), /usr/lib64/php/modules/phalcon.so.so (/usr/lib64/php/modules/phalcon.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning: Module 'psr' already loaded in Unknown on line 0

CentOS php 7.3, phalcon 4, psr 0.7.0

what could be the problem? because everything works.

P.s. eg:

[[email protected] public_html]# php -v

PHP Warning: PHP Startup: Unable to load dynamic library 'phalcon.so' (tried: /usr/lib64/php/modules/phalcon.so (/usr/lib64/php/modules/phalcon.so: undefined symbol: php_json_decode_ex), /usr/lib64/php/modules/phalcon.so.so (/usr/lib64/php/modules/phalcon.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning: Module 'psr' already loaded in Unknown on line 0

PHP 7.3.13 (cli) (built: Dec 17 2019 10:29:15) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.13, Copyright (c) 1998-2018 Zend Technologies

You need to load json extension before phalcon.



4.3k

You need to load json extension before phalcon.

in the system or config php?

In php config.



4.3k

In php config.

echo phpinfo();

shows: json support enabled && json version 1.7.0

then is not the case?

edited Feb '20

No, this is still the case, you need to make sure it's loaded before phalcon, not after. Otherwise you will have error like this. You can possibly have in conf.d folder in etc/php, at least on ubuntu etc, there you need to change prioritites so phalcon is loaded as last.

If phalcon is loaded via php.ini, try to remove it from there and use conf.d with proritity liek 90-phalcon.ini



10.1k
edited Feb '20

PHP cmd line can have different settings then the one you are approaching from your browser. To see your loaded extensions type:

php -m

To show the locations of your ini file use by the php cmd line

php --ini

All required extensions can be found here: https://docs.phalcon.io/4.0/en/installation

But it's not an issue that he has not loaded json extension, it's issue that phalcon is loaded before json, and that's why he has error php_json_decode_ex because it doesn't exists yet.



4.3k

No, this is still the case, you need to make sure it's loaded before phalcon, not after. Otherwise you will have error like this. You can possibly have in conf.d folder in etc/php, at least on ubuntu etc, there you need to change prioritites so phalcon is loaded as last.

If phalcon is loaded via php.ini, try to remove it from there and use conf.d with proritity liek 90-phalcon.ini

I deleted phalcon.so and psr.so of php.ini and the error has disappeared. thanks :)



4.3k

PHP cmd line can have different settings then the one you are approaching from your browser. To see your loaded extensions type:

php -m

To show the locations of your ini file use by the php cmd line

php --ini

All required extensions can be found here: https://docs.phalcon.io/4.0/en/installation

thanks for the answer)))

edited Feb '20

PHP cmd line can have different settings then the one you are approaching from your browser. To see your loaded extensions type:

php -m

To show the locations of your ini file use by the php cmd line

php --ini 

All required extensions can be found here: https://docs.phalcon.io/4.0/en/installation

thanks for the answer)))

You can possibly have in conf.d folder in etc/php, MyPrepaidCenter at least on ubuntu etc, there you need to change prioritites so phalcon is loaded as last.



127

But it's no longer an difficulty that he has no longer loaded json extension, it is problem that phalcon is loaded earlier than json, herehttps://forum.phalcon.io/discussion/19989/do-i-have-to-place-the-same-main-view-in-multiple-places-when-us#C64517 and that is why he has blunders php_json_decode_ex as it doesn't exists but.