运行命令:php artisan route:cache产生以下执行:
Erroneous data format for unserializing 'Symfony\Component\Routing\CompiledRoute'
Run Code Online (Sandbox Code Playgroud)
运行:php artisan route:clear修复它
我想知道如何解决这个问题,以便我可以缓存我的路线。
小智 9
这对我有用
php artisan optimize:clear
php artisan config:clear
php artisan config:cache
composer dump-autoload
Run Code Online (Sandbox Code Playgroud)
在弄清楚了一堆事情之后。我发现 Apache2 仍在使用旧版本的 PHP,尽管 CLI 版本是最新的。
卸载所有旧版本的 php 并重新配置 Apache2 以使用最新版本后修复了此问题。