php安装

1 安装依赖软件

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel sqlite-devel \
oniguruma-devel autoconf

 

######## 使用yum安装php######################

yum install -y oniguruma-devel openssl-devel gcc gcc-c++ wget make libxml2 libxml2-devel openssl openssl-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel bison autoconf sqlite-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libxslt-devel libxslt libzip-devel libtidy-devel libtidy gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel expat-devel xmlrpc-c xmlrpc-c-devel libmemcached-devel libsqlite3x-devel

 

 

 

yum remove libzip libzip-devel -y

rpm -ivh https://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm

yum install wlibzip -y

 

2 编译安装

./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--with-curl \
--with-MySQL=/usr/local//php/mysql \
--with-freetype-dir=/usr/local/php/freetype \
--enable-gd \
--with-gettext \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-pear \
--with-png-dir=/usr/local/libpng \
--with-jpeg-dir=/usr/local/libjpeg \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--with-zlib-dir=/usr/local/zlib \
--with-bz2 \
--with-mhash \
--with-zip \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-xml \
--enable-zip \
--enable-fpm


3. 配置环境变量
vim /etc/profile

export PATH=$PATH:/usr/local/php/bin

4. 安装扩展(pecl安装)

 

 

 

参考链接: https://learnku.com/articles/54621

 

二 容器部署

部署一个容器然后制作成镜像,多启动几个组成集群,提高并发量

 

安装swoole拓展

pecl install swoole-4.2.12
启用swoole拓展

docker-php-ext-enable swoole

容器制作镜像
docker commit 4e5a6a90097b php7.4-fpm-20221005:01

启动新容器

 

posted @ 2022-10-05 17:52  woaibaobei  阅读(61)  评论(0编辑  收藏  举报