一旦工作,那就要努力的干,聪明的干,快速的干——用省下来的时间干自己喜欢干的事情。!

centos 7 php7 下编译memcached模块提示缺少php_smart_str.h怎样解决?

linux lampnick 4793℃ 0评论

centos 7 php7 提示缺少php_smart_str.h怎样解决?

1、编译Memcache

wget https://github.com/websupport-sk/pecl-memcache/archive/php7.zip #下载memcache源文件
tar zxvf php7.zip #解压php7.zip,出现pecl-memcache-php7
cd pecl-memcache-php7
/usr/local/php7/bin/phpize --with-php-config=/usr/local/php7/bin/php-config #我的PHP7安装在/usr/local/php7下面,你需要根据自己的PHP位置进行修改
./configure --prefix=/usr/local/memcache --with-php-config=/usr/local/php7/bin/php-config
make && make install

2、修改php.ini文件,加载Memcache组件。

extension="/usr/local/php7/lib/php/extensions/no-debug-zts-20151012/memcache.so"

3、重启Apache

/usr/local/httpd/bin/apachectl restart

4、安装Memcached的步骤,首先需要安装Libevent。

wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar vxf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure -prefix=/usr/local/libevent
make && make install

5、编译Memcached

wget http://memcached.org/files/memcached-1.4.25.tar.gz
tar vxf memcached-1.4.25.tar.gz
cd memcached-1.4.25
./configure --prefix=/usr/local/memcached -with-libevent=/usr/local/libevent
make && make install

6、启动Memcached

/usr/local/memcached/bin/memcached -u nobody -d -m 64 #具体想怎样配置看你的需求了

开机/重启后生效,编辑 /etc/rc.d/rc.local 文件,添加以下内容。

/usr/local/memcached/bin/memcached -u nobody -d -m 64

7、查看是否生效。

ps aux|grep memcached
nobody 23508 0.0 0.1 314916 1124 pts/0 Sl+ 14:55 0:00 /usr/local/memcached/bin/memcached -u nobody -m 64 -vv
root 23553 0.0 0.1 112644 920 pts/3 R+ 15:17 0:00 grep --color=auto memcached

至此,OK!

转载请注明:MitNick » centos 7 php7 下编译memcached模块提示缺少php_smart_str.h怎样解决?

喜欢 (3)or分享 (0)
头像
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址