开发者

PHP unable to load Memcached extension due to json?

It says "undefined symbol: php_json_encode" but开发者_如何学JAVA json is installed already? also, when i add json.so to the php.ini, it say that module is already loaded?


Because you add json.so into php.ini and do not remove the php.d/json.ini

Error shows the reason: json.so should be loaded before memcached.so

Please use php -m | grep memcached to check whether memcached.so is loaded successfully.

  • If it shows memcached, this means it has succeeded.
  • If its show like PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: undefined symbol: php_json_decode_ex in Unknown on line 0

Here is the solution: e.g. your php.ini is /etc/php.ini, your php.d is /etc/php.d/

Solution 1

  1. comment 'memcached.so' in php.ini
  2. vim /etc/php.d/memcached.ini
  3. add extension=memcached.so in /memcached.ini
  4. php -m | grep memcached to check whether memcached is successfully loaded

Solution 2

  1. rm /etc/php.d/json.ini
  2. add extension=json.so in php.ini before extension=memcached.so
  3. php -m | grep memcached to check whether memcached is successfully loaded
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜