Chronos FrozenTime error

Warning (2): Declaration of Cake\Chronos\Traits\FrozenTimeTrait::setTime($hours, $minutes, $seconds = 0) should be compatible with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL) in [/home/wmcmiinz/www/librdesthes21/www/vendor/cakephp/chronos/src/MutableDate.php, line 24]

V 3.3

When in dev mode (only a subfolder of the main site), everything work well.
When moving the cake directory at the root level, I have this error message and thousands of errors in the debug error file.

What does it mean ? What do I have do change ?

You seem to be on a pretty old version of CakePHP and the Chronos Plugin.

Have you tried updating via composer?

As I was just talking with @Zuluru he mentioned that your problem seems to be related with the PHP DateTime Class.

In PHP 7.1 the last parameter $microseconds was added.
https://www.php.net/manual/en/datetime.settime.php

And therefore your outdated version of cakephp/chronos is not compatible anymore with PHP 7.1

So either update your app and your dependencies (which I would highly recommend) or downgrade to PHP 7.0

Thank you for showing interest in my problem.

But it is really incomprehensible.
My client server runs php 5.8.
Cake version is 3.3
Current site is in : server/current/site (url = http://www.domain_name)
Dev site is in : server/dev/
When going to domain_name/dev everything works fine.
So after making changes I renamed server/current to server/old
and I renamed server/dev to server/current

And then I have thousands Chronos errors.
Nothing has changed except directory name.
Everything else is ok → all links, css files, js files, images …

Well, there’s no such thing as PHP 5.8, so…

Sorry it is 5.6 (typo)

I would really discourage you to “switch” DEV and LIVE website environments by renaming folders.

1 Like

Is there any reason ?

I have been doing that for years without particular problem.

So your DEV environment works with the same database aka same data as the LIVE environment?
And you have Debugging enabled on your LIVE environment as well?
Or installed dev dependencies on your LIVE environment?

When doing an update, I duplicate the app AND the database.
I would not work on the production db.
The live directory is left unchanged.
When update is done, original directory is renamed “archive_xx” and dev directory is renamed “current”.
I also keep a local copy of the latest version to work with if necessary.

Do as you like. The only thing I would do if I have problems with vendor/composer modules I would remove the vendor folder and re-install all modules with composer install

This is what I have done and everything works well now !

Thank you all for advices and help.