Hi,
I've setup CentOS 7.4 with PHP 7.2.2 and all the required plugins.
When running php artisan app:install, I get:
Clearing settings cache...
Settings cache cleared!
Backing up database...
Dumping database and uploading...
Successfully dumped mysql, compressed with gzip and store it to local at /var/www/html/Cachet/database/backups/2018-02-07 03.17.51
Backup completed!
Application key [base64:GnohIAUv/ErZPJrIaOHPx4ETgLpkZrXbwd5FE5lNJRU=] set successfully.
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Copied Directory [/vendor/roumen/feed/src/views] To [/resources/views/vendor/feed]
Publishing complete for tag []!
Nothing to migrate.
Clearing cache...
PHP Fatal error: Uncaught ErrorException: count(): Parameter must be an array or an object that implements Countable in /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionIdentifier.php:51
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'count(): Parame...', '/var/www/html/C...', 51, Array)
#1 /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionIdentifier.php(51): count(NULL)
#2 /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionHandlerTrait.php(47): GrahamCampbell\Exceptions\ExceptionIdentifier->identify(Object(ErrorException))
#3 /var/www/html/Cachet/bootstrap/cache/compiled.php(2163): GrahamCampbell\Exceptions\ExceptionHandler->report(Object(ErrorException))
#4 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(ErrorException))
#5 {main}
thrown in /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionIdentifier.php on line 51
PHP Fatal error: Uncaught ErrorException: count(): Parameter must be an array or an object that implements Countable in /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionIdentifier.php:51
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'count(): Parame...', '/var/www/html/C...', 51, Array)
#1 /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionIdentifier.php(51): count(NULL)
#2 /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionHandlerTrait.php(47): GrahamCampbell\Exceptions\ExceptionIdentifier->identify(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#3 /var/www/html/Cachet/bootstrap/cache/compiled.php(2163): GrahamCampbell\Exceptions\ExceptionHandler->report(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#4 /var/www/html/Cachet/bootstrap/cache/compiled.php(2181): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalErrorException))
in /var/www/html/Cachet/vendor/graham-campbell/exceptions/src/ExceptionIdentifier.php on line 5
Is this down to a compatibility issue?
Ok it seems for 7.2.1 I would need 2.4 branch.
@captainhook In PHP 7.2, a non-countable object displays a warning as seen here. It looks like the way the ExceptionIdentifier is written caused a backwards incompatible change. "Environments that display warnings or convert them to more severe errors/exceptions would be affected, but this should just bring attention to a bug in the code."
I'm having the same issue, so I'll do some research and try to come up with a fix.
I can confirm this.
Cachet is not compatible to PHP7.2 (at least for Ubuntu 16.04 LTS + Apache2) due to this error.
Edit: Adjusting the title may raise awareness btw.
This appears to be an error with Graham Campbell's Exception package for Laravel. It hit a snag with 7.2 based on the count() method not receiving a countable object. I've submitted a PR for it here.
upgrade to 9.4 or higher, where I fixed this
Given the fact he's part of the Cachet team they should already know that they'd need to update the dependency. 🤔
@captainhook update the exceptions package from Graham Campbell to ^9.4 in your composer.json and it should work for now.
$ composer require "graham-campbell/exceptions:^9.4"
Sounds good. As long as this is still compatible of course.
@MarkL4YG i'm actually running it right now and i'll update you as soon as i complete the install.
That was fast xD. Great news 👍
Updating the exceptions package to 9.4 does not have any effect on it. There is still some instance that is being passed that is not Countable. I don't see why having a function to check if it is countable is an issue. This is a breaking change that doesn't work with PHP 7.2, yet having that function passes all tests and fixes the 7.2 issue.
With that PR, if you can fix the thing that is causing the variable to be set to null, that would be really great, rather than adding a check.
@GrahamCampbell will do, thanks!
What's the status on this? I'm still seeing this nearly 2 years later.
Im having the same issues as well
You guys might want to share some logs/copy of the error so we can see what exactly is happening.
@JacobDB if you read all the messages above, you'll see I was using an incompatible version of PHP. Since then Cachet has been updated to work with PHP 7.1.3 – 7.3.
I fixed it, it was due to php version 7.3 and not being on 2.4, switching php to 5.6 fixed it, thanks.
On Feb 29, 2020, at 1:06 PM, captainhook notifications@github.com wrote:
You guys might want to share some logs/copy of the error so we can see what exactly is happening.@JacobDB if you read all the messages above, you'll see I was using an incompatible version of PHP. Since then Cachet has been updated to work with PHP 7.1.3 – 7.3.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
@aiso-net switching to PHP 5.6 is not a fix. PHP 5.6 was EOL over a year ago. Any PHP apps you use should be using at minimum PHP 7.2 and preparing to migrate to PHP 7.3+.
Cachet is fully compatible with PHP 7.3, so you need to have a look at your error message/logs and go from there.
Having this same error with php7.4.3 during install, specifically on the postinstall step artisan optimize --force. Cachet from master
Yep, php7.4 here and still an issue. Why is this closed?
Cachet does not support PHP 7.4 yet.
That's right, my bad. But, I tried 7.3 and it also didn't work. I fixed the issue but I forgot how.
I can still experience this issue. I'm on PHP 7.3.
On php7.2, still experiencing this issue.
On php7.4, still experiencing this issue.