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
- comment 'memcached.so' in php.ini
vim /etc/php.d/memcached.ini
- add
extension=memcached.so
in /memcached.ini php -m | grep memcached
to check whether memcached is successfully loaded
Solution 2
rm /etc/php.d/json.ini
- add
extension=json.so
in php.ini beforeextension=memcached.so
php -m | grep memcached
to check whether memcached is successfully loaded
精彩评论