升级PHP
webman需要php8以上才可使用,建议使用php8.3
我用的是oneinstack,以下所有操作是基于oneinstack的,如果你用的是宝塔或者1panel,请自己酌情修改
安装igbinary插件
1.igbinary是第三方插件,oneinstack包里没有,只能自己手动安装
wget https://pecl.php.net/get/igbinary-3.2.16.tgz
tar xf igbinary-3.2.16.tgz
cd igbinary-3.2.16
/usr/local/php/bin/phpize # 这里根据你自己的phpize路径调整
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
2.安装完之后修改/usr/local/php/etc/php.ini文件,添加以下代码
extension=igbinary.so
3.最后重启一下php
systemctl restart php-fpm
升级xiaoVXB
就算已经是最新版本了也要重新升级一下,只有检测到php8以上才会安装webman相关软件包
./update.sh
安装supervisor
1.改一下默认源: /etc/apt/sources.list
修改后apt update一下
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security bullseye-security main contrib non-free
我是debian11,如果你不是的话无需这步
2.安装supervisor
apt install supervisor
如果没有python需要先安装python
3.创建配置文件
在/etc/supervisor/conf.d目录下创建一个webman.conf。添加以下内容
[program:webman]
directory=/data/wwwroot/你的网站目录
command=/usr/local/php/bin/php -c cli-php.ini webman.php start
stdout_logfile=/data/wwwroot/你的网站目录/storage/logs/webmanout.log
stderr_logfil= /data/wwwroot/你的网站目录/storage/logs/webmanerr.log
autorestart=true
user=root
4.然后重新加载一下supervisor
supervisorctl reload
修改伪静态
将网站的伪静态修改为
location /downloads {
}
location / {
try_files $uri $uri/ @backend;
}
location ~ (/config/|/manage/|/webhook|/payment|/order|/theme/) {
try_files $uri $uri/ /index.php$is_args$query_string;
}
location @backend {
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:6600;
}
location ~ .*\.(js|css)?$
{
expires 1h;
error_log off;
access_log /dev/null;
}