Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Matomo is functional with PHP 8.4 #22471

Closed
tsteur opened this issue Aug 5, 2024 · 18 comments · Fixed by #22667
Closed

Ensure Matomo is functional with PHP 8.4 #22471

tsteur opened this issue Aug 5, 2024 · 18 comments · Fixed by #22667
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. triaged
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Aug 5, 2024

PHP 8.4 will be released on 21st Nov 2024 and we need to make sure that Matomo will work with this new version of PHP. That means a release needs to have happened by then.

It's still a few months away but figured to already create the issue now so we can schedule the issue in advance for around the time when the first RC releases come out.

@tsteur tsteur added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. To Triage An issue awaiting triage by a Matomo core team member labels Aug 5, 2024
@innocraft-automation innocraft-automation added this to the 5.3.0 milestone Aug 6, 2024
@des-innocraft des-innocraft added triaged and removed To Triage An issue awaiting triage by a Matomo core team member labels Aug 8, 2024
@innocraft-automation innocraft-automation modified the milestone: 5.3.0 Sep 13, 2024
@narfk
Copy link

narfk commented Sep 25, 2024

Just a note:
Starting from PHP 8.4, the functions strtok() and md5() are marked as deprecated. Both functions appear frequently in the Matomo code. This won’t throw any errors but may be logged depending on the configuration.

@jostreff
Copy link

Fix PHP 8.4 deprecation: Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead - too many such cases in source.

@jostreff
Copy link

Also I have errors shown like this:

Deprecated: DI\Definition\Resolver\ObjectCreator::setPrivatePropertyValue(): Optional parameter $className declared before required parameter $propertyValue is implicitly treated as a required parameter in /usr/local/www/matomo/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php on line 212

Deprecated: Constant E_STRICT is deprecated in /usr/local/www/matomo/vendor/symfony/var-dumper/Caster/ExceptionCaster.php on line 44

Deprecated: Constant E_STRICT is deprecated in /usr/local/www/matomo/vendor/symfony/var-dumper/Caster/ExceptionCaster.php on line 44

Deprecated: Constant E_STRICT is deprecated in /usr/local/www/matomo/vendor/symfony/var-dumper/Caster/ExceptionCaster.php on line 44

@jostreff
Copy link

My checks are made with
PHP 8.4.0RC2 (cli) (built: Oct 16 2024 18:32:40) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.0RC2, Copyright (c) Zend Technologies
with Zend OPcache v8.4.0RC2, Copyright (c), by Zend Technologies

@sgiehl
Copy link
Member

sgiehl commented Oct 21, 2024

For PHP 8.4 we need to disable the error reporting for deprecation notices. While we were able to update all the deprecation notices caused in our code, we are not able to solve those that happen in the vendor libraries we are using.

Unfortunately we can't update libraries like php-di/php-di, as newer versions require at least PHP 8. Same applies for a couple of other libraries. So we may keep deprecation notices disabled for PHP 8.4+ until we dropped support for PHP < 8

@sgiehl
Copy link
Member

sgiehl commented Oct 21, 2024

Just a note:
Starting from PHP 8.4, the functions strtok() and md5() are marked as deprecated. Both functions appear frequently in the Matomo code. This won’t throw any errors but may be logged depending on the configuration.

Neither strtok() nor md5() have been deprecated with PHP 8.4. The suggestions to deprecate those methods have been rejected. See https://wiki.php.net/rfc/deprecations_php_8_4

@jostreff
Copy link

jostreff commented Nov 6, 2024

how can I get proposed changes from GitHub?

@michalkleiner
Copy link
Contributor

Not sure what you mean exactly @jostreff, can you elaborate?

@jostreff
Copy link

how to download version with patches for 8.4 compatibility from GitHub?

@sgiehl
Copy link
Member

sgiehl commented Nov 12, 2024

@jostreff You can simply checkout the github project. Or is you want to have a Matomo package you can download one of the latest beta releases from https://builds.matomo.org/

@jostreff
Copy link

Thanks, I have get https://builds.matomo.org/matomo-5.2.0-b5.tar.gz and extracted all files, overwriting my existing installation. The result is that matomo works, but it shows messages like this:

Deprecated: DI\Definition\Resolver\ObjectCreator::setPrivatePropertyValue(): Optional parameter $className declared before required parameter $propertyValue is implicitly treated as a required parameter in /usr/local/www/matomo/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php on line 212

Deprecated: Zend_Db_Statement_Mysqli::_execute(): Implicitly marking parameter $params as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/libs/Zend/Db/Statement/Mysqli.php on line 183

Deprecated: Zend_Db_Statement::execute(): Implicitly marking parameter $params as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/libs/Zend/Db/Statement.php on line 294

Deprecated: Piwik\Updater::__construct(): Implicitly marking parameter $columnsUpdater as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Updater.php on line 64

Deprecated: Piwik\Plugin\Dimension\VisitDimension::shouldForceNewVisit(): Implicitly marking parameter $action as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Plugin/Dimension/VisitDimension.php on line 243

Deprecated: Piwik\CacheId::siteAware(): Implicitly marking parameter $idSites as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/CacheId.php on line 32

Deprecated: Piwik\Plugins\CoreHome\Columns\Metrics\CallableProcessedMetric::__construct(): Implicitly marking parameter $semanticType as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/plugins/CoreHome/Columns/Metrics/CallableProcessedMetric.php on line 22

Deprecated: Piwik\Plugins\Referrers\Columns\Campaign::shouldForceNewVisit(): Implicitly marking parameter $action as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/plugins/Referrers/Columns/Campaign.php on line 37

Deprecated: Piwik\Plugins\Referrers\Columns\Website::shouldForceNewVisit(): Implicitly marking parameter $action as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/plugins/Referrers/Columns/Website.php on line 23

Deprecated: Piwik\Archive\ArchiveInvalidator::getRememberedArchivedReportsThatShouldBeInvalidated(): Implicitly marking parameter $idSite as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 159

Deprecated: Piwik\Archive\ArchiveInvalidator::markArchivesAsInvalidated(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 274

Deprecated: Piwik\Archive\ArchiveInvalidator::addParentPeriodsByYearMonth(): Implicitly marking parameter $originalDate as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 432

Deprecated: Piwik\Archive\ArchiveInvalidator::markArchivesOverlappingRangeAsInvalidated(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 458

Deprecated: Piwik\Archive\ArchiveInvalidator::reArchiveReport(): Implicitly marking parameter $plugin as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 501

Deprecated: Piwik\Archive\ArchiveInvalidator::reArchiveReport(): Implicitly marking parameter $report as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 501

Deprecated: Piwik\Archive\ArchiveInvalidator::reArchiveReport(): Implicitly marking parameter $startDate as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 501

Deprecated: Piwik\Archive\ArchiveInvalidator::reArchiveReport(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 501

Deprecated: Piwik\Archive\ArchiveInvalidator::scheduleReArchiving(): Implicitly marking parameter $pluginName as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 585

Deprecated: Piwik\Archive\ArchiveInvalidator::scheduleReArchiving(): Implicitly marking parameter $startDate as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 585

Deprecated: Piwik\Archive\ArchiveInvalidator::scheduleReArchiving(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 585

Deprecated: Piwik\Archive\ArchiveInvalidator::markArchivesInvalidated(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Archive/ArchiveInvalidator.php on line 722

Deprecated: Piwik\DataAccess\Model::__construct(): Implicitly marking parameter $logger as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/DataAccess/Model.php on line 38

Deprecated: Piwik\DataAccess\Model::updateArchiveAsInvalidated(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/DataAccess/Model.php on line 111

Deprecated: Piwik\DataAccess\Model::updateRangeArchiveAsInvalidated(): Implicitly marking parameter $segment as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/DataAccess/Model.php on line 314

Deprecated: Piwik\Session\SessionAuth::__construct(): Implicitly marking parameter $userModel as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Session/SessionAuth.php on line 49

Deprecated: Piwik\Plugin\Report::getMetricsForTable(): Implicitly marking parameter $report as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Plugin/Report.php on line 1075

Deprecated: Piwik\Plugin\Report::getProcessedMetricsForTable(): Implicitly marking parameter $report as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Plugin/Report.php on line 1107

Deprecated: Piwik\Metrics\Formatter::formatMetrics(): Implicitly marking parameter $report as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/core/Metrics/Formatter.php on line 177

Deprecated: Zend_Exception::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead in /usr/local/www/matomo/libs/Zend/Exception.php on line 43

@jostreff
Copy link

I forgot to mention also this message:
WARNING: /libs/Zend/Session.php(272): Deprecated - session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated - Matomo 5.1.2 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already) (Module: Installation, Action: systemCheckPage, In CLI mode: false)

@sgiehl
Copy link
Member

sgiehl commented Nov 12, 2024

Ah sorry, my fault. I thought we had released a beta after the fixed for PHP 8.4, but it had been released a couple of days before that. You may need to wait for the next beta or preview release, which might happen this or next week.

@caddoo caddoo modified the milestones: 5.3.0, 5.2.0 Nov 18, 2024
@innocraft-automation innocraft-automation removed this from the 5.2.0 milestone Nov 18, 2024
@jostreff
Copy link

https://www.php.net/ChangeLog-8.php#8.4.1

no new build published on builds.matomo.org still.

@ronak-innocraft ronak-innocraft added this to the 5.2.0 milestone Nov 24, 2024
@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/warning-libs-zend-session-php-272-deprecated-session-set-save-handler/61413/2

@jostreff
Copy link

jostreff commented Dec 4, 2024

Anything? At least new beta version published?

@sgiehl
Copy link
Member

sgiehl commented Dec 4, 2024

@jostreff we plan to have a release candidate today/tomorrow and the final release in one or two weeks.

@jostreff
Copy link

jostreff commented Dec 5, 2024

@sgiehl First impressions with 5.2-RC1 under 8.4.1 - it works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants