Class 'Memcache' not found in
Moved to the site hosting from Network Solutions, the error o开发者_JAVA技巧ccurred
Fatal error: Class 'Memcache' not found in / data / ... / include / connect.inc on line 6
How can I fix it? I created a php.ini file in the folder cgi bin, added there the line extension = "memcache.so". But apparently the module itself is not on the server. What should I do? Hosted by usual, is not VPS.
Sorry for my English :)
I would use the phpinfo()
output to identify where the php.ini
file is and whether the Memcache module is loaded.
If the server is not managed by you then you might have problems getting this PECL module installed.
Please use php -m | grep memcached
to check whether memcached.so is loaded successfully.
- If show memcached
, this mean it succeeded.
- Else it is not loaded
Or check phpinfo, see whether there is a Memcached SectionL like this
if php -m | grep memcached
shows:
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 solusion: 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
check whether memcached is succeed loaded
Solution 2
rm /etc/php.d/json.ini
- add
extension=json.so
in php.in beforeextension=memcached.so
php -m | grep memcached
check whether memcached is succeed loaded
精彩评论