Home > Backend Development > PHP Tutorial > memcached - linux下安装php的memcache扩展

memcached - linux下安装php的memcache扩展

WBOY
Release: 2016-06-06 20:16:08
Original
903 people have browsed it

linux下安装php的memcached扩展,没有任何报错信息,已修改php.ini文件。重启nginx后发现phpinfo中并没有显示memcached模块的扩展。
安装其他php的扩展也是这个样子,没有报错但是不加载扩展。

回复内容:

linux下安装php的memcached扩展,没有任何报错信息,已修改php.ini文件。重启nginx后发现phpinfo中并没有显示memcached模块的扩展。
安装其他php的扩展也是这个样子,没有报错但是不加载扩展。

如果是Ubuntu/Debian,用apt安装的话可以这样:

<code>sudo apt-get install php5-memcached
</code>
Copy after login

如果你的PHP是编译安装,则可以这样编译php5-memcached:
https://pecl.php.net/package/memcached

<code>cd memcached-2.2.0
/png/php/5.4/bin/phpize 生成 configure
./configure --with-php-config=/png/php/5.4/bin/php-config
make && make install
</code>
Copy after login

然后在php.ini中加入:

<code>extension=memcached.so
</code>
Copy after login

重启Apache或PHP-FPM服务生效.

pecl install memcached

问题已经解决,是我把php.ini文件放错了位置。谢谢各位。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template