由于前文“Centos 7.2 yum安装php7”中升级了php到php7,导致之前可以正常使用的phpmyadmin、memcache等无法继续使用,需要重新编译安装,memcache目前未找到有效的解决方法,只好重新安装memcached来替代之前的memcache。此处介绍memcached的安装编译。
1、试图按以前的经验,直接升级memcache:
[root@iZ23d ~]# pecl upgrade memcache
bash: pecl: command not found...
根据这边的提示,需要安装相应的 yum install php-devel php-pear httpd-devel
[root@iZ23d ~]#
yum install php70w-devel php70w-pear php70w-httpd-devel
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
。。。。 【其中省略】
Warning: RPMDB altered outside of yum.
Installing : php70w-process-7.0.0-1.w7.x86_64 1/4
Installing : php70w-xml-7.0.0-1.w7.x86_64 2/4
Installing : 1:php70w-pear-1.10.1-1.w7.noarch 3/4
Installing : php70w-devel-7.0.0-1.w7.x86_64 4/4
Verifying : php70w-devel-7.0.0-1.w7.x86_64 1/4
Verifying : php70w-xml-7.0.0-1.w7.x86_64 2/4
Verifying : 1:php70w-pear-1.10.1-1.w7.noarch 3/4
Verifying : php70w-process-7.0.0-1.w7.x86_64 4/4
Installed:
php70w-devel.x86_64 0:7.0.0-1.w7 php70w-pear.noarch 1:1.10.1-1.w7
Dependency Installed:
php70w-process.x86_64 0:7.0.0-1.w7 php70w-xml.x86_64 0:7.0.0-1.w7
Complete!
继续按偷懒的方法升级:
[root@iZ23d ~]#
pecl upgrade memcache
downloading memcache-2.2.7.tgz ...
Starting to download memcache-2.2.7.tgz (36,459 bytes)
.....done: 36,459 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
。。。 【其中省略】
config.status: executing libtool commands
running: make
/bin/sh /var/tmp/pear-build-rootEb5cjP/memcache-2.2.7/libtool --mode=compile cc -I/usr/include/php -I. -I/var/tmp/memcache -DPHP_ATOM_INC -I/var/tmp/pear-build-rootEb5cjP/memcache-2.2.7/include -I/var/tmp/pear-build-rootEb5cjP/memcache-2.2.7/main -I/var/tmp/memcache -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/memcache/memcache.c -o memcache.lo
libtool: compile: cc -I/usr/include/php -I. -I/var/tmp/memcache -DPHP_ATOM_INC -I/var/tmp/pear-build-rootEb5cjP/memcache-2.2.7/include -I/var/tmp/pear-build-rootEb5cjP/memcache-2.2.7/main -I/var/tmp/memcache -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/memcache/memcache.c -fPIC -DPIC -o .libs/memcache.o
/var/tmp/memcache/memcache.c:40:40:
fatal error:
ext/standard/php_smart_str.h: No such file or directory
#include "ext/standard/php_smart_str.h"
^
compilation terminated.
make: *** [memcache.lo]
Error 1
ERROR: `make' failed
说明升级失败,缺乏 php_smart_str.h 文件,查看是否有相应文件的源文件:
[root@iZ23d ~]# find / -name php_smart_str.h
/root/php-5.4.16/ext/standard/php_smart_str.h
以上说明 php5中有相应的文件,但是已经下载并解压的 php7源安装包中却没有相应文件,而
这边前人的经验也表面,可能是Php7本身的某些扩展未做到位。
而根据这边的说法,