Laravel-compact():未定义的变量:Builder.php中的运算符 [英] Laravel - compact(): Undefined variable: operator in Builder.php

查看:32
本文介绍了Laravel-compact():未定义的变量:Builder.php中的运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的系统中安装了PHP版本7.3,而Laravel-5.8中安装了PHP版本.当我尝试在使用Laravel-5.4和PHP Version-5.6.4的旧项目上摩擦composer安装或composer更新时,出现以下错误:

I have PHP version-7.3 installed in my system and Laravel-5.8. When I tried to rub composer install or composer update on an old Project with Laravel-5.4 and PHP Version-5.6.4, I got this error shown below:

在Builder.php第1229行中:compact():未定义变量:运算符脚本php artisan优化处理错误代码为1的返回的post-install-cmd事件

In Builder.php line 1229: compact(): Undefined variable: operator Script php artisan optimize handling the post-install-cmd event returned with error code 1

然后,当我尝试运行该应用程序时,出现了此错误页面,如屏幕上所示:

Then, when I tried to run the application, I got this error page as shown on the screen:

我试图跑步:

php artisan cache:clear

php artisan cache:clear

作曲家更新

但是问题仍然存在.

如何解决?

谢谢.

推荐答案

根据此信息,看来此问题已在Laravel 5.5中修复: https://github.com/laravel/framework/issues/26936#issuecomment-449479336

It looks like this issue was fixed in Laravel 5.5 according to this post: https://github.com/laravel/framework/issues/26936#issuecomment-449479336

由于不再支持Laravel 5.4,因此最好的选择是升级.您可以在此处找到当前受支持的版本的列表: https://laravel.com/docs/releases

Since Laravel 5.4 is no longer supported, your best option might be to upgrade. You can find a list of the currently supported versions here: https://laravel.com/docs/releases

仍应修复该错误的最小升级为5.4到5.5.可以在这里找到说明: https://laravel.com/docs/5.5/upgrade#upgrade-5.5.0 (请注意,对5.5的支持也已终止,但仍可能会解决您的错误).这还需要您将项目切换到PHP 7.0.0或更高版本.

The minimal upgrade that should still fix the error would be 5.4 to 5.5. The instructions can be found here: https://laravel.com/docs/5.5/upgrade#upgrade-5.5.0 (please note that support for 5.5 has also ended, but it might still fix your bug). This would also require you to switch the project to PHP 7.0.0 or greater.

这篇关于Laravel-compact():未定义的变量:Builder.php中的运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆