美文网首页
OpenWRT中让_可道云_在_PHP8_中运行

OpenWRT中让_可道云_在_PHP8_中运行

作者: 夏日De雨 | 来源:发表于2023-03-15 14:22 被阅读0次

LEDE 的 OpenWRT 中,安装 可道云,会失败。

原因是系统的php用了 php8 的版本。不兼容。

为了让可道云跑起来。

启动脚本需要修改

--- /etc/init.d/kodexplorer      2022-06-01 13:35:43.173013847 +0800

+++ /etc/init.d/kodexplorer.old    2022-06-01 16:07:13.654597420 +0800

@@ -110,7 +110,7 @@

                ;doc_root = "/www"

                user_dir =

-              extension_dir = "/usr/lib/php8"

+              extension_dir = "/usr/lib/php"

                enable_dl = On

                cgi.fix_pathinfo=1

@@ -147,14 +147,14 @@

        [ "$ENABLED" = "0" ] && return 0

        mkdir -p $TEMP_PATH /var/log/nginx /var/lib/nginx

        gen_php_config

-      /usr/bin/php8-fpm -R -y $PHP_FPM_CONFIG -g "/var/run/php8-fpm.pid"

+      /usr/bin/php-fpm -R -y $PHP_FPM_CONFIG -g "/var/run/php8-fpm.pid"

        gen_nginx_config $NGINX_CONFIG

        /usr/sbin/nginx -c $NGINX_CONFIG >/dev/null 2>&1 &

}

stop() {

        /usr/sbin/nginx -c $NGINX_CONFIG -s stop >/dev/null 2>&1 &

-      killall -9 php8-fpm >/dev/null 2>&1 &

+      killall -9 php-fpm >/dev/null 2>&1 &

        rm -f /var/run/kodexplorer_php8-fpm.pid

        rm -f /var/log/kodexplorer_php8-fpm.log

        rm -f /var/run/php8-fpm.sock

记得把php8 的extension包都装齐

kodexplorer/app/kod/Services_JSON.class.php 有兼容性问题。

要把类似 $chrs{$c} 这样的,改为 $chrs[$c] (约11处), $var{...} 改为 $var[...] (约18处)。

有好多地方都要改。

可道云就工作正常了

相关文章

网友评论

      本文标题:OpenWRT中让_可道云_在_PHP8_中运行

      本文链接:https://www.haomeiwen.com/subject/fumlrdtx.html