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
Full PHP7 compatibility #8689
Comments
Here is a change we may need to make, regarding error handling and fatal errors Reading: http://daveyshafik.com/archives/69237-an-exceptional-change-in-php-7-0.html
|
I finally got PHP 7 running via phpbrew after compiling PHP > 20 times and trying php-build+phpenv etc and nothing really worked. Using phpbrew now as I want to manage different versions of PHP in one VM (under Ubuntu). In case someone wants to do the same I used At some point I got stuck though with this error: Having a look at this issue they might not start working on support for PHP 7 before it is released: twigphp/Twig#1695 (comment) which could be a blocker for us. Update: Noticed issue is about extension and I think only |
@tsteur were you able to install piwik on php7 without this extension? (the mbstring extension should be marked as required) |
I used my existing installation, so just updated the PHP version. I think this can be quite a common scenario, especially now that maybe more will upgrade to newer PHP versions for Piwik 3.0. For this I created: #8700 |
This will be a big problem for our tests: https://bugs.php.net/bug.php?id=69158 and it is not considered a bug for PHP: You can also see it eg https://travis-ci.org/piwik/piwik/jobs/78564129#L678 in unit tests, http://builds-artifacts.piwik.org/piwik/piwik/8689/15171/ in UI tests and in https://travis-ci.org/piwik/piwik/jobs/78564127 for system tests We'd basically have to rewrite each |
this was an un-expected "BC break"!
Not a great solution, but maybe acceptable for now: could we skip these tests on PHP7? |
Depends how many there are, we'd need to skip quite a few of them but would be possible. We'd also need to skip many UI tests and I'm not sure if the framework can do this. We need to go through each failing test and see if it is only a "different order issue" or whether there are also other things wrong. |
Is it feasible to change your sorting callback to guarantee a certain order even if it doesn't matter? Say if you're sorting elements ['a' => ..., 'b' => ...] by column 'a', then instead of function ($x, $y) {
return $x['a'] <=> $y['a'];
} use function ($x, $y) {
return $x['a'] == $y['a'] ? $x['b'] <=> $y['b'] : $x['a'] <=> $y['a'];
} I have no idea if this is feasible for your use cases, but it might be better to just guarantee a sort order than provide different test vectors for different PHP versions. |
That's what I meant with
We need to add more checks eg other properties and/or array indices. I think there are about 20 |
FYI: Here's a migration guide: http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.variable-handling.array-order |
Good news! Piwik 2.15.0-beta9 should support more or less PHP7 Please test the beta and report here any feedback. |
Can I do a fresh install of v2.15.0-beta9? Is there a link to a zip somewhere? i.e. I don’t have a running installation of piwik already on my php7 machine. And I couldn’t install v2.14.3 because of an issue with |
Hi @jonnybarnes, On builds.piwik.org you can find all versions. |
Excellent, installed 2.15.0-b12, seems to be working. |
I just downloaded the fresh RC3 for windows - VC14 x64 Non Thread Safe (2015-Sep-17 00:25:12) Testsuite is not running fine completely (i will try to fix some with a PR)
|
PHP 7 compatibility is not fully done yet and needs quite a bit of more work and testing. In addition we're depend on one or two dependencies that are not PHP 7 compatible yet. I made the changes that were needed to make Piwik usable with PHP 7 and so that tests run (not succeed but at least they run now). Unit and integration tests succeeded on travis we might have to test it with Windows as well. |
@tsteur i just checked it. The errors should be gone/"fixed" with a PhpUnit upgrade (Error/Throwable upgrade) sebastianbergmann/phpunit@f3e2635 The 15 failures are all the same...i check if i have a wrong setting maybe |
Actually, I had a problem there too. I did use that latest PHPUnit version but in the vendor directory it had still the old code of that change for some reason and I think I did change it manually to test it locally and I was definitely using the latest PHPUnit version from vendor... it was very weird :) Anyway, |
Seems to be working for me on 2.16 beta 1, no issues discovered yet. |
Hi, I just upgraded my sites to PHP 7.0.1 stable but Piwik 2.5.0 has become unavailable. It runs well and reach the main screen but seems not detect any sites previously declared - not show the site's list. Fortunately my hosting plan allows me to change to any older PHP version from 4.0 to 7.0.1 and I've detected that Piwik runs well for me until PHP 5.6 but not for PHP 7.0.1 Also in Config panel show me a message similar to "Note: You can't modify config in this section because you don't own any web site that could be managed by an anonymous user" If you need more info about it, please ask me for it. Do you know if I could do anything to fix it or I should wait for a new Piwik release? |
@manper555: Piwik 2.5.0 is pretty old (2014-08-15) see https://piwik.org/changelog/ |
Since PHP 7 is still maturing, before closing this ticket, testing of piwik should be done with latest available version PHP 7 (this time 7.0.1) |
@hpvd: Thank you. I was confident in Piwik's updates seeker that is telling me that I'm in the latest version, but it seems doesn't work properly. I'll upgrade to the 2.15 today. Best regards. |
@manper555: update checker should be working fine in later versions. In settings you can choose update tree: final or beta |
just a question: is there any news on this? If so, it would be great
btw: Are there already any benchmarks done? |
FYI: I switched my personal blog to PHP 7 to test WP-Piwik. Piwik as well as WP-Piwik are working as expected. 😄 |
Thanks @braekling for the feedback! @hpvd yes, LTS officially supports PHP7. We will later enable our tests for PHP7 to be more confident of our ongoing support: #9858 |
@braekling and @mattab |
I had an issue with usort and PHP7+ and HHVM this is how i solved it. https://github.com/johnnymast/Sandbox/blob/master/src/Traits/ArrayFilter.php#L15 Altho there is a litle bug i notice but you will be able to understand |
Thanks for sharing @johnnymast 👍 |
Hi @ThaDafinser maybe you are still interested to help us get the build green on PHP7? If so, we'd love to hear from you and work on this together sometime 👍 |
Here are the commands I used to upgrade to PHP7 on Ubuntu on Apache 2.4:
|
Hello everyone, It seems that Piwik 2.16.1 is already compatible with PHP7, and Piwik 2.16.2 will fix a few remaining issues. Therefore, we consider Piwik to be PHP7 compatible, and will support all Piwik users who are on PHP7. The remaining still opened PHP7 issues are:
Also, https://demo.piwik.org now runs on PHP 7.* |
this post may help for future php migration issues: |
The goal of this issue is to verify and ensure that Piwik is fully compatible with PHP7.
PHP7 will surely be quickly adopted by the PHP community. By officially supporting PHP7 our community will be able to enjoy the latest PHP running their Piwik platform.
The text was updated successfully, but these errors were encountered: