编译安装完nginx 启动时提示如下
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
解决方案:
ln -s /usr/local/lib/libpcre.so.1 /lib64
前提要安装 zlib-1.2.8.tar.gz pcre-8.10.tar.gz
安装php7
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-opcache --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-short-tags --with-libxml-dir --enable-opcache --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext
直接打开 163 源网站:http://mirrors.163.com/.help/centos.html
按照使用说明,还是先备份一下源(使用下面的命令重命名原来的源,如果有错误,再改回来):
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
转到源目录:
cd /etc/yum.repos.d/
按照自己的版本下载源,我是CentOS 7,使用命令:
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
运行以下命令生成缓存:
yum clean all
yum makecache
就这么简单,继续享用 CentOS 7!!!!!
安装swoole phpredis扩展
编译安装php7
wget -c http://www.php.net/distributions/php-7.0.0.tar.gz tar zxvf php-7.0.0.tar.gz cd php-7.0.0 ./configure \ --prefix=/usr/local/php7 \ --with-config-file-path=/usr/local/php7/etc \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-iconv-dir \ --with-freetype-dir=/usr/local/freetype \ --with-jpeg-dir -\ -with-png-dir \ --with-zlib \ --with-libxml-dir=/usr \ --enable-xml \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --enable-mbregex \ --enable-mbstring \ --with-mcrypt \ --enable-ftp \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --with-gettext \ --disable-fileinfo \ --enable-opcache make ZEND_EXTRA_LIBS='-liconv' make install cp php.ini-production /usr/local/php7/etc/php.ini cd ..
编译安装php7的redis扩展支持
wget -c https://github.com/phpredis/phpredis/archive/php7.zip unzip php7.zip cd phpredis-php7 /usr/local/php7/bin/phpize ./configure --with-php-config=/usr/local/php7/bin/php-config make make install cd ..
/usr/local/php7/etc/php.ini
中加入
extension=redis.so
编译安装php7的swoole
wget -c https://github.com/swoole/swoole-src/archive/swoole-1.7.21-stable.tar.gz tar zxvf swoole-1.7.21-stable.tar.gz cd swoole-src-swoole-1.7.21-stable/ /usr/local/php7/bin/phpize ./configure --with-php-config=/usr/local/php7/bin/php-config make make install cd ..
/usr/local/php7/etc/php.ini
中加入
extension=swoole.so