VPS侦探论坛

 找回密码
 注册
查看: 4687|回复: 5

lnmp1.2安装memcached的问题

[复制链接]
发表于 2015-8-13 17:02:34 | 显示全部楼层 |阅读模式

lnmp1.2安装好memcached后,需要修改php.ini文件和重启lnmp吗?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-8-15 09:17:29 | 显示全部楼层


不需要,全部自动完成
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-8-16 21:16:19 | 显示全部楼层

安装了为什么php还是不能用


[root@s1 Samples]# ps -ef|grep memcached
root     18887     1  0 16:49 ?        00:00:00 /usr/local/memcached/bin/memcached -d -l 127.0.0.1 -p 11211 -u root -m 64 -c 1024 -P /var/run/memcached.pid
root     28395 28229  0 21:20 pts/0    00:00:00 grep --color=auto memcached

代码如下:

Fatal error: Class 'Memcache' not found in

$memcache_obj = new Memcache;

$memcache_obj->connect('127.0.0.1', 11211);

$memcache_obj->set('var_key', 'some really big variable', MEMCACHE_COMPRESSED, 50);

echo $memcache_obj->get('var_key');
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-8-16 21:17:42 | 显示全部楼层

PHP已编译模块检测也有memcached




PHP已编译模块检测
Core  date  ereg  libxml  openssl  pcre  sqlite3  zlib  bcmath  ctype  curl  dom  filter  
ftp  gd  gettext  hash  iconv  json  mbstring  mcrypt  SPL  session  standard  mysqlnd  PDO  
pdo_mysql  pdo_sqlite  Phar  posix  Reflection  mysqli  shmop  SimpleXML  soap  sockets  SQLite  mysql  sysvsem  
tokenizer  xml  xmlreader  xmlrpc  xmlwriter  zip  cgi-fcgi  memcached  mhash  Zend Guard Loader
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-8-16 21:34:17 | 显示全部楼层

是不是因为版本lnmp版本不一致导致 php版本不一致导致的,

我是重新下载了lnmp1.2安装的 memcached

当前的lnmp环境是很久之前安装的
        PHP版本(php_version):         5.3.28

军哥运维代购:http://shop63846532.taobao.com/

发表于 2015-8-17 09:26:40 | 显示全部楼层

你php模块里显示你装的php-memcached扩展,而你的代码却用php-memcache的方式连接,你觉得可以吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 05:34 , Processed in 0.025818 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表