yshir-phper 2019-10-19 10:03:51 1088 收藏
分類專欄: docker
版權
1、命令進入容器中
docker exec -it php sh(基於alpine的命令,如果是centos則使用bash)
2、安裝redis、swoole擴展
#安裝pecl
wget http://pear.php.net/go-pear.phar -O go-pear.php
php go-pear.php
##回車默認安裝
#使用pcel命令安裝
pcel install redis
pcel install swoole
如果出現以下錯誤,說明沒有安裝autoconf
接下來安裝autoconf
#1、基於alpine系統安裝autoconf
安裝 autoconf(無configure腳本時):apk add --no-cache -U autoconf
安裝 C 編譯器:apk add --no-cache -U gcc
安裝 make
安裝 linux 內核文件頭 linux-headers:apk add --no-cache -U linux-headers
報:
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared
錯誤時需要安裝 libc-dev:apk add --no-cache -U libc-dev
報 No curses library functions found,需安裝 ncurses-dev:apk add --no-cache -U ncurses-dev
#2、基於centos系統安裝autoconf
安裝 autoconf: yum -y install autoconf
安裝 C 編譯器:yum -y install gcc gcc-c++ kernel-devel
#3、基於MacOS系統安裝autoconf
brew install autoconf
brew install homebrew/versions/gcc5
#4、基於Ubuntu系統安裝autoconf
apt-get install autoconf
apt-get build-dep gcc
下圖錯誤說明需要安裝gcc
————————————————
版權聲明:本文為CSDN博主「yshir-phper」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/qq_39399966/article/details/102628044