问题描述:
将网站目录迁移到移动硬盘,修改nginx配置后,主页报错
flarum版本16
php7.4,nginx1.18(已开启SSL),宝塔面板7.5.2,Debian GNU/Linux 10(Py3.7.8)
报错内容:
[2021-04-26 12:11:03] flarum.ERROR: Error: Call to a member function compile() on int in /disk/data/lcssbbs/vendor/wikimedia/less.php/lib/Less/Tree/Ruleset.php:91
Stack trace:
#0 /disk/data/lcssbbs/vendor/wikimedia/less.php/lib/Less/Parser.php(190): Less_Tree_Ruleset->compile()
#1 /disk/data/lcssbbs/vendor/flarum/core/src/Frontend/Compiler/LessCompiler.php(84): Less_Parser->getCss()
#2 /disk/data/lcssbbs/vendor/flarum/core/src/Frontend/Compiler/RevisionCompiler.php(150): Flarum\Frontend\Compiler\LessCompiler->compile()
#3 /disk/data/lcssbbs/vendor/flarum/core/src/Frontend/Compiler/RevisionCompiler.php(80): Flarum\Frontend\Compiler\RevisionCompiler->save()
#4 /disk/data/lcssbbs/vendor/fof/nightmode/src/Content/Assets.php(107): Flarum\Frontend\Compiler\RevisionCompiler->commit()
#5 /disk/data/lcssbbs/vendor/fof/nightmode/src/Content/Assets.php(42): FoF\NightMode\Content\Assets->commit()
#6 /disk/data/lcssbbs/vendor/flarum/core/src/Frontend/Frontend.php(63): FoF\NightMode\Content\Assets->__invoke()
#7 /disk/data/lcssbbs/vendor/flarum/core/src/Frontend/Frontend.php(55): Flarum\Frontend\Frontend->populate()
#8 /disk/data/lcssbbs/vendor/flarum/core/src/Frontend/Controller.php(32): Flarum\Frontend\Frontend->document()
#9 /disk/data/lcssbbs/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\Frontend\Controller->handle()
#10 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http{closure}()
#11 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ExecuteRoute->process()
#12 /disk/data/lcssbbs/vendor/fof/ban-ips/src/Middleware/RegisterMiddleware.php(93): Laminas\Stratigility\Next->handle()
#13 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): FoF\BanIPs\Middleware\RegisterMiddleware->process()
#14 /disk/data/lcssbbs/vendor/fof/terms/src/Middlewares/RegisterMiddleware.php(48): Laminas\Stratigility\Next->handle()
#15 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): FoF\Terms\Middlewares\RegisterMiddleware->process()
#16 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/FlarumPromotionHeader.php(29): Laminas\Stratigility\Next->handle()
#17 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\FlarumPromotionHeader->process()
#18 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/ShareErrorsFromSession.php(57): Laminas\Stratigility\Next->handle()
#19 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ShareErrorsFromSession->process()
#20 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(36): Laminas\Stratigility\Next->handle()
#21 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\CheckCsrfToken->process()
#22 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
#23 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ResolveRoute->process()
#24 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\Stratigility\Next->handle()
#25 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\SetLocale->process()
#26 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\Stratigility\Next->handle()
#27 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\AuthenticateWithSession->process()
#28 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#29 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\RememberFromCookie->process()
#30 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#31 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\StartSession->process()
#32 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/CollectGarbage.php(46): Laminas\Stratigility\Next->handle()
#33 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\CollectGarbage->process()
#34 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#35 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ParseJsonBody->process()
#36 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#37 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\HandleErrors->process()
#38 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle()
#39 /disk/data/lcssbbs/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#40 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\RequestHandler->process()
#41 /disk/data/lcssbbs/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
#42 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\BasePathRouter->process()
#43 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\Stratigility\Next->handle()
#44 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Middleware\OriginalMessages->process()
#45 /disk/data/lcssbbs/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#46 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\BasePath->process()
#47 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#48 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ProcessIp->process()
#49 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle()
#50 /disk/data/lcssbbs/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\Stratigility\MiddlewarePipe->process()
#51 /disk/data/lcssbbs/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
#52 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#53 /disk/data/lcssbbs/public/index.php(26): Flarum\Http\Server->listen()
#54 {main}
调试模式报错内容:
Warning: count(): Parameter must be an array or an object that implements Countable in /disk/data/lcssbbs/vendor/wikimedia/less.php/lib/Less/Tree/Ruleset.php on line 234
Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in /disk/data/lcssbbs/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:24 Stack trace: #0 /disk/data/lcssbbs/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(40): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent() #1 /disk/data/lcssbbs/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput() #2 /disk/data/lcssbbs/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(98): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit() #3 /disk/data/lcssbbs/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run() #4 /disk/data/lcssbbs/public/index.php(26): Flarum\Http\Server->listen() #5 {main} thrown in /disk/data/lcssbbs/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php on line 24
已尝试的解决办法:
更改权限755,更改目录所有者,检查nginx配置,重启nginx
仍无法解决问题,求助大神
网址:
https://www.shushi.space/