Cakephp 3.1存在PHP7.2的问题

问题描述 投票:0回答:2

我使用cakephp 3.1开发了我的Web应用程序。我的服务提供商已将php版本更新为7.2。现在我的应用程序运行不正常,因为它正在使用PHP5.6,它显示与debug=true;不同的警告和大问题是它没有显示有一些问题的行,如果有的话。这是警告信息。

Warning: count() [function.count]: Parameter must be an array or an object that implements Countable in D:\xampp7\htdocs\bighris\vendor\cakephp\cakephp\src\Database\QueryCompiler.php on line 115

如果有一些错误没有显示它,以下列方式,我找不到行号和有问题的文件。

https://www.screencast.com/t/qIQB1YIW

请帮我解决这个问题,谢谢

warnings cakephp-3.0 php-7.2
2个回答
0
投票

根据Cakephp github问题:

PHP 7.2改变了count的行为,这就是你得到错误的原因。

PHP 7.2 has changed count's behavior causing problems with QueryCompiler

您可以按照以下链接或将PHP版本更改为7.1或更低版本来解决此问题。

Stop warnings when using count in QueryCompiler in PHP 7.2


0
投票

看起来你传递了一些错误的数据来计算函数,猜测你是直接将一些查询传递给count。或类似的东西。如果您可能显示您遇到问题的控制器代码,则可能会有很大帮助。

© www.soinside.com 2019 - 2024. All rights reserved.