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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南