linux 安装多个php

官网下载需要的版本:https://www.php.net/downloads.php 

复制代码
# 下载7.4
wget https://www.php.net/distributions/php-7.4.32.tar.gz
# 解压
tar -xzvf php-7.4.32.tar.gz
cd php-7.4.32
./configure --prefix=/usr/local/php74 --exec-prefix=/usr/local/php74 --bindir=/usr/local/php74/bin --sbindir=/usr/local/php74/sbin --includedir=/usr/local/php74/include --libdir=/usr/local/php74/lib/php --mandir=/usr/local/php74/php/man --with-config-file-path=/usr/local/php74/etc --with-mcrypt=/usr/local/libmcrypt --with-mhash --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-gd --with-iconv --with-zlib --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-fpm --without-gdbm --disable-fileinfo --enable-opcache=no

make && make install
 cd /usr/local/php74/etc
复制代码
复制代码
cp php-fpm.conf.default php-fpm.conf

# 进入
cd /usr/local/php74/etc/php-fpm.d
cp www.conf.default www.conf
vim www.conf
# 将listen 端口9000改为未被占用的端口
listen = 127.0.0.1:9001
# 修改运行用户及用户组
user = www
group = www
复制代码

运行:

/usr/local/php74/sbin/php-fpm

 

posted @   php的自我修养  阅读(199)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示