VPS侦探论坛

 找回密码
 注册
查看: 6424|回复: 4

为什么php不安装memcached扩展呢?我需要使用

[复制链接]
发表于 2013-9-7 18:10:13 | 显示全部楼层 |阅读模式

默认的是memcache 扩展, 请问怎么安装memcached扩展, 这个比memcache的bug少很多
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-9-7 20:16:54 | 显示全部楼层


php-memcached依赖libmemcached理论上应该效率更高些

安装的话安装上前面说的libmemcached
apt-get 或yum安装就行,debian下软件包包的名字是libmemcached-dev

再按标准扩展安装流程http://pecl.php.net/package/memcached 上下载安装https://www.vpser.net/manage/lnmp-php-install-ext.html
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-9-10 00:59:23 | 显示全部楼层

回复 2# 的帖子


memcached-2.1.0]# make
/bin/sh /root/memcached-2.1.0/libtool --mode=compile cc -I/usr/local/php/include/php  -I. -I/root/memcached-2.1.0 -DPHP_ATOM_INC -I/root/memcached-2.1.0/include -I/root/memcached-2.1.0/main -I/root/memcached-2.1.0 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/libmemcached//include  -DHAVE_CONFIG_H  -g -O2   -c /root/memcached-2.1.0/php_memcached.c -o php_memcached.lo
mkdir .libs
cc -I/usr/local/php/include/php -I. -I/root/memcached-2.1.0 -DPHP_ATOM_INC -I/root/memcached-2.1.0/include -I/root/memcached-2.1.0/main -I/root/memcached-2.1.0 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/libmemcached//include -DHAVE_CONFIG_H -g -O2 -c /root/memcached-2.1.0/php_memcached.c  -fPIC -DPIC -o .libs/php_memcached.o
/root/memcached-2.1.0/php_memcached.c:318: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c:319: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c:320: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_get_impl’中:
/root/memcached-2.1.0/php_memcached.c:599: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_getMulti_impl’中:
/root/memcached-2.1.0/php_memcached.c:797: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:800: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_fetch’中:
/root/memcached-2.1.0/php_memcached.c:1014: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:1017: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_fetchAll’中:
/root/memcached-2.1.0/php_memcached.c:1068: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:1071: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getServerList’中:
/root/memcached-2.1.0/php_memcached.c:1948: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getServerByKey’中:
/root/memcached-2.1.0/php_memcached.c:1977: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getStats’中:
/root/memcached-2.1.0/php_memcached.c:2056: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getVersion’中:
/root/memcached-2.1.0/php_memcached.c:2089: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在文件层:
/root/memcached-2.1.0/php_memcached.c:2576: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_serverlist_callback’中:
/root/memcached-2.1.0/php_memcached.c:2583: 错误:‘instance’未声明(在此函数内第一次使用)
/root/memcached-2.1.0/php_memcached.c:2583: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
/root/memcached-2.1.0/php_memcached.c:2583: 错误:所在的函数内也只报告一次。)
/root/memcached-2.1.0/php_memcached.c: 在文件层:
/root/memcached-2.1.0/php_memcached.c:2593: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_stats_callback’中:
/root/memcached-2.1.0/php_memcached.c:2599: 错误:‘instance’未声明(在此函数内第一次使用)
/root/memcached-2.1.0/php_memcached.c: 在文件层:
/root/memcached-2.1.0/php_memcached.c:2637: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_version_callback’中:
/root/memcached-2.1.0/php_memcached.c:2644: 错误:‘instance’未声明(在此函数内第一次使用)
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_result_callback’中:
/root/memcached-2.1.0/php_memcached.c:3191: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:3194: 警告:赋值丢弃了指针目标类型的限定
make: *** [php_memcached.lo] 错误 1




安装的时候出现如下报错
libmemcached-1.0.17     安装的时候倒是没问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-9-10 08:39:23 | 显示全部楼层



看官网上issue这个错误只能用libmemcached 1.0.16
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-9-10 14:38:39 | 显示全部楼层

改成 1.06 ,搞定了, 谢谢

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-15 20:53 , Processed in 0.026549 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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