ext-ds: Error after add extension=ds.so to php.ini
If i run command
php -d extension=ds.so some_file.php
Then Ds extension works ok. But when i want add this line to php.ini:
extension=ds.so
Then php throw error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/ds.so'
- /usr/lib/php/20151012/ds.so: undefined symbol: php_json_serializable_ce in Unknown on line 0
My PHP version: PHP 7.0.3 on Ubuntu 14.04
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 6
- Comments: 40 (16 by maintainers)
Commits related to this issue
- Merge pull request #2 from remicollet/issue-ship ship tests and doc — committed to php-ds/ext-ds by rtheunissen 6 years ago
- load module after json module PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php71/ds.so' - /usr/lib64/php71/ds.so: undefined symbol: php_json_serializable_ce in Unknown on lin... — committed to pld-linux/php-pecl-ds by glensc 5 years ago
@rtheunissen ok,
json
extension was loaded in additional ini file (conf.d). To fix this problem i create new file (for example30-ds.ini
) with contentextension=ds.so
and put it in /etc/php/7.0/fpm/conf.d. Nowds
extension is load as last:Thanks for help 👍
I was getting the same Unable to load dynamic library … undefined symbol: php_json_serializable_ce issue as @itcraftsmanpl on Linux Mint, regardless of whether I installed using pecl install ds or did git clone and built the code. Changing /etc/php/7.0/mods-available/ds.ini to be:
and then doing
worked, but only after I manually removed all the 20-ds.ini symbolic links. Thanks so much for this extension!
@rtheunissen - Other extensions are also suffering from this. The issue is with distribution’s PHPs not doing the standard PHP thing. I have written an explanation at https://derickrethans.nl/undefined-symbol.html about the how and why.
There is currently a hard dependency on the
json
extension, which is a bug because it shouldn’t try to implementJsonSerializable
if thejson
extension is not loaded.Try enabling the json extension, or specifying
ds.so
afterjson
is already enabled.encountered this issue too, fixed it by creating a symlink called
/etc/php/7.3/cli/conf.d/25-ds.ini
so the/etc/php/7.3/cli/conf.d/20-json.ini
will load first@chippyash
extension=ds.dll
orextension=php_ds.dll
isn’t it?I’m using Fedora 25 (PHP 7.0.20) and I have had the same problem. Just creating a new config file
/etc/php.d/50-ds.ini
, as teached on @derickr post, worked perfectly.Inside the file, just
extension=ds.so
is needed.This is so infuriating, how are other extensions not also running into this problem / how is this still a thing? Thanks for all the feedback here everyone, I’m going to link the readme directly to this issue.
Well, I found that even though I edit /etc/php/7.0/mods-available/ds.ini to look like:
; configuration for php ds module ; priority=30 extension=ds.so
And even though I first did
$ sudo phpdismod ds
This did not remove the 20-ds.ini symbolic links
$ cd /etc/php/7.0/ $ find . -name “*ds.ini”
./apache2/conf.d/20-ds.ini ./fpm/conf.d/20-ds.ini ./mods-available/ds.ini ./cli/conf.d/20-ds.ini ./cli/conf.d/30-ds.ini
So that after I edited /etc/php/7.0/mods-available/ds.ini to be:
; configuration for php ds module ; priority=30 extension=ds.so
instead of
; configuration for php ds module ; priority=20 extension=ds.so
and eve after I did
$ sudo phpdismod ds
before doing
$ sudo phpenmod ds
The old 2-ds.ini symbolic links were still present, and I had to manually remove them by hand.
This showed that there were both 20-ds.ini and 30-ds.ini symbolic links.
On 10/20/2016 08:51 AM, Andreu Correa Casablanca wrote:
I’ve added a note in README.md, not much else that can be done.