PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, December 31, 2021

[FIXED] Cakephp 3.1 have issues with PHP7.2

 December 31, 2021     cakephp-3.0, php-7.2     No comments   

Issue

I have develop my web application by using cakephp 3.1. My service provider has update the php version to 7.2. Now my application is not work well, as it was working with PHP5.6, Its showing different warnings with debug=true; and the big problem is its not showing line which have some problem, if some is there. Here is warning message.

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

In case some errors are there its not showing it, in the following way, there I can't find the line number and the file which have the problem.

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

Please help me to solve the issue, Thanks


Solution

As per the Cakephp github issues:

PHP 7.2 has changed count's behavior that's why you are getting errors.

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

You can follow the below link or change your PHP version to 7.1 or less to resolve this issue.

Stop warnings when using count in QueryCompiler in PHP 7.2



Answered By - Sehdev
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing