mongodb.so: undefined symbol: php_json_serializable_ce in Unknown on line 0

I’ve encountered following error when running mongodb php module

Dec 12 09:56:02 lj php-fpm[3142]: [12-Dec-2016 09:56:02] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mongodb.so' - /usr/lib64/php/modules/mongodb.so: undefined symbol: php_json_serializable_ce in Unknown on line 0

Few google searches reveal this can be fixed by simply making sure json is loaded prior to mongodb.so – which by default isn’t.
There are many ways to do that, for example find how your json is loaded

[root@lj php.d]# php -i | grep "json"
/etc/php.d/json.ini,

Now open json.ini and add

extension=mongodb.so

at the end – and remove mongodb.ini from the folder.

Or rename json.ini to 20-json.ini and mongodb.ini to 30-mongodb.ini
You can also add priority at top of the ini file priority=30

Don’t forget to restart php after each change, if you are running mod_php, just do systemctl restart httpd, for php-fpm it’s systemctl restart php-fpm.

Now the weird thing is – none of this worked for me.
No matter how I loaded mongodb, it always failed with this error. I got the latest pecl packages, everything up to date – it simply didn’t work.
The only solution for me was to roll back to previous version of mongodb

[root@lj php.d]# pecl uninstall mongodb
[root@lj php.d]# pecl install mongodb-1.1.9
[root@lj php.d]# echo "extension=mongodb.so" > /etc/php.d/zz-99-mongo.ini

I called the file zz-99 to make sure it’s always loaded last. My ini files do not start with 20-*.ini to set priority.
Good luck.

Write a Comment

Comment

Webmentions

  • online konzultace pro kamagra

    získat obecný kamagra

    kamagra cena v kanadě

  • buy cheap itraconazole generic a canada

    buy generic itraconazole no prescription

    can you buy itraconazole over counter

  • order fildena for sale usa

    how to buy fildena generic ireland

    how to buy fildena uk cheap purchase buy

  • comment faire prescrire un médecin kamagra

    achat kamagra bon marche prix

    achat kamagra france prix

  • buy gabapentin us prices

    cheap gabapentin australia over the counter

    online order gabapentin generic good

  • buy cheap flexeril cyclobenzaprine generic london

    purchase flexeril cyclobenzaprine cheap with fast shipping

    cheap flexeril cyclobenzaprine buy online usa

  • discount dutasteride generic buy online

    get dutasteride canada fast shipping

    get dutasteride generic lowest price

  • buying avodart generic is good

    buying avodart purchase uk

    buy avodart cost effectiveness

  • buying staxyn cheap online in the uk

    cheapest buy staxyn australia buy online

    purchase staxyn purchase online safely

  • how to buy xifaxan uk order

    ordering xifaxan generic london

    order xifaxan generic brand

  • how to buy rifaximin purchase from canada

    how to buy rifaximin cheap real

    rifaximin overnight delivery saturday

  • how to order enclomiphene generic does it work

    cheap enclomiphene generic when available

    how to buy enclomiphene american express canada

  • buy cheap androxal generic overnight delivery

    how to buy androxal canada shipping

    buying androxal generic lowest price