'Memcache' not found in command line PHP script

后端 未结 5 1600
不知归路
不知归路 2020-12-11 01:23

I have Memcache installed and working for PHP apps run through Apache (v2.2) but when I try to run a .php file in the command-line i get this error:

Fatal er         


        
5条回答
  •  青春惊慌失措
    2020-12-11 01:51

    Presumably you have separate php.ini files set up for apache and the command line (cli).

    If so, you need to add the following to your cli php.ini file:

    extension=memcache.so
    

    On Ubuntu it's in /etc/php5/cli/php.ini

    If it's working then memcache should appear in the list of modules if you run php -m on the command line.

    Alternatively, you can create a file /etc/php5/cond.d/memcache.ini with the same contents.

提交回复
热议问题