首页>>帮助中心>>香港vps服务器的DirectAdmin编译安装多个PHP版本

香港vps服务器的DirectAdmin编译安装多个PHP版本

2023/8/28 289次

香港vps服务器的DirectAdmin目前支持最多4版本的PHP同时安装及使用,安装命令如下:

1、进入安装目录

#directadmin安装多个版本PHP

cd /usr/local/directadmin/custombuild

./build update

2-1、执行操作命令

./build set php1_release=5.6

./build set php1_mode=php-fpm

./build set php2_release=7.4

./build set php2_mode=php-fpm

./build set php3_release=7.3

./build set php3_mode=php-fpm

./build set php4_release=8.0

./build set php4_mode=php-fpm

执行以上命令将会把这些命令写入 options.conf 文件中,并且是写在配置文件最后面的。

执行了以上步骤可以跳过2-2

2-2、可以直接选择写入命令

#或者直接编辑

vi options.conf

php1_release=5.6

php1_mode=php-fpm

php2_release=7.4

php2_mode=php-fpm

php3_release=7.3

php3_mode=php-fpm

php4_release=8.0

php4_mode=php-fpm

3、开始编译安装php

./build php n

./build rewrite_confs

开始编译php时,会通过 php.net将需要的php版本下载到目录 /usr/local/directadmin/custombuild/cache 中,下载过程中可能出现网络波动导致下载失败,可以重复尝试。

4-1、常见错误 一

mod_ruid2 is not supported anymore, please set mod_ruid2=no in CustomBuild 'options.conf'.

这个错误需要进入 options.conf配置文件中修改 mod_ruid2 = no

4-2、常见错误 二

php3_release has been set twice in the options.conf. This will cause problems. Edit it to remove one of them.

这个错误是上面2-12-2重复执行了,需要打开options.conf配置文件将重复项删除。

4-3、常见错误 三

%curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104

这个错误是在编译时,连接php.net下载php版本文件时网络波动造成的连接重置,可以尝试重复执行编译命令。

一诺网络香港免备案专区,提供「香港增强VPS」和「香港特惠VPS」两种类型的高可用弹性计算服务,搭载新一代英特尔®至强®铂金处理器,接入CN2低延时高速回国带宽线路,网络访问顺滑、流畅。机房网络架构采用了BGP协议的解决方案可提供多线路互联融合网络,使得不同网络运营商线路的用户都能通过最佳路由实现快速访问。香港云VPS低至29/月,购买链接:https://www.enuoidc.com/vps.html?typeid=2