4
votes

After success install I'm getting the below error

 NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/solr.so' - /usr/lib64/php/modules/solr.so: undefined symbol: php_json_decode_ex in Unknown on line 0

can any one help me out in this Issue ?

my server details are as:- php : PHP 5.4.16 (cli) (built: Aug 11 2016 21:24:59) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologie

nginx: nginx version: nginx/1.10.1

When I'm executing this php -v

I'm getting the below message:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/solr.so' - /usr/lib64/php/modules/solr.so: undefined symbol: php_json_decode_ex in Unknown on line 0

PHP 5.4.16 (cli) (built: Aug 11 2016 21:24:59) Copyright (c) 1997-2013 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

2
Check this link it may help, stackoverflow.com/questions/8157709/…Himanshu Sharma
@HimanshuSharma Thanks for your link, but as you can see my answer I have resolved my issue.vijaybir singh

2 Answers

6
votes

After doing a lot of experiments I finally fixed the issue. The solution is as below:

cd /etc/php.d/

And create a file named solr.ini.

Added this line:

extension=solr.so

And now I have to remove the above extension from the php.ini file and restart php-fpm

That's all, worked for me.

2
votes

Still got error. Realized you need to load solr.so after json.so, so the json symbols are in memory before solr is loaded, otherwise solr fails to load.

On centos and Red Hat Enterprise Server simply give solr the highest number out of the numbered ini files in /etc/php.d. You may just need to make it load after json.ini, but I'm loading it last and now it works. I named it 60-solr.ini and it started working.