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

Full PHP7 compatibility #8689

Closed
10 of 11 tasks
mattab opened this issue Sep 2, 2015 · 43 comments
Closed
10 of 11 tasks

Full PHP7 compatibility #8689

mattab opened this issue Sep 2, 2015 · 43 comments
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Sep 2, 2015

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.

@mattab mattab added this to the 2.15.0 milestone Sep 2, 2015
@mattab
Copy link
Member Author

mattab commented Sep 2, 2015

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

Another important change in PHP 7 is with catchable fatal errors. Previously, these would have been caught and handled using set_error_handler(). However, with PHP 7, they are now \Error exceptions, which, because an uncaught exception is now a real fatal error, will no-longer be catchable in set_error_handler().
This is a backwards compatibility break and means that to work in both PHP 5.x and 7, you need to use both set_error_handler() and try... catch.
This is considered a minor BC break due to limited usage.

@tsteur
Copy link
Member

tsteur commented Sep 2, 2015

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 phpbrew install next +apxs2 +json +hash +mhash +ctype +pdo +zip +gd +mysql +mbstring +mbregex +iconv +zlib +filter +sockets +mcrypt +fileinfo +bz2 +sqlite && phpbrew ext install curl && phpbrew ext install openssl && phpbrew ext install xdebug && phpbrew -d ext install gd -- --with-libdir=lib/x86_64-linux-gnu --with-gd=shared --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr

At some point I got stuck though with this error:

image

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 mbstring extension was missing see #4999

@mattab
Copy link
Member Author

mattab commented Sep 2, 2015

@tsteur were you able to install piwik on php7 without this extension? (the mbstring extension should be marked as required)

@tsteur
Copy link
Member

tsteur commented Sep 3, 2015

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

@tsteur
Copy link
Member

tsteur commented Sep 3, 2015

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: usort changes how it treats equal values. You can see a simple example in the issue tracker. Many of our unit, integration, system and ui tests are now failing because the order is different and I'm not sure how we're supposed to make the tests run on PHP 5.X and PHP 7.

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 usort and somehow never return 0. Instead we probably need to compare the index of array entries etc (which can be slow)

@mattab
Copy link
Member Author

mattab commented Sep 5, 2015

this was an un-expected "BC break"!

Many of our unit, integration, system and ui tests are now failing because the order is different and I'm not sure how we're supposed to make the tests run on PHP 5.X and PHP 7.

Not a great solution, but maybe acceptable for now: could we skip these tests on PHP7?

@tsteur
Copy link
Member

tsteur commented Sep 7, 2015

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.

@nikic
Copy link

nikic commented Sep 7, 2015

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.

@tsteur
Copy link
Member

tsteur commented Sep 7, 2015

That's what I meant with

We'd basically have to rewrite each usort and somehow never return 0. Instead we probably need to compare the index of array entries etc (which can be slow)

We need to add more checks eg other properties and/or array indices. I think there are about 20 uasort, sort to possibly change. We can possibly adjust many of our system tests by updating the DataTable\Sort filter

@tsteur
Copy link
Member

tsteur commented Sep 9, 2015

tsteur added a commit that referenced this issue Sep 22, 2015
@mattab
Copy link
Member Author

mattab commented Sep 22, 2015

Good news!

Piwik 2.15.0-beta9 should support more or less PHP7

Please test the beta and report here any feedback.

@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Sep 22, 2015
@jonnybarnes
Copy link

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 always_populate_raw_post_data.

@RMastop
Copy link
Contributor

RMastop commented Sep 22, 2015

Hi @jonnybarnes,

On builds.piwik.org you can find all versions.

@jonnybarnes
Copy link

Excellent, installed 2.15.0-b12, seems to be working.

@ThaDafinser
Copy link
Contributor

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)

............................................................  840 / 2935 ( 28%)
............................................................  900 / 2935 ( 30%)
............................................................  960 / 2935 ( 32%)
............................................................ 1020 / 2935 ( 34%)
............................................................ 1080 / 2935 ( 36%)
...........................................................F 1140 / 2935 ( 38%)
FFFF..FF.FF................................................. 1200 / 2935 ( 40%)
.............F.....F.F.....F...........F.................... 1260 / 2935 ( 42%)
............................................................ 1320 / 2935 ( 44%)
............................................................ 1380 / 2935 ( 47%)
..F......................................................... 1440 / 2935 ( 49%)
..............E...........E................................. 1500 / 2935 ( 51%)
............................................................ 1560 / 2935 ( 53%)
............................................................ 1620 / 2935 ( 55%)
............................................................ 1680 / 2935 ( 57%)
............................................................ 1740 / 2935 ( 59%)
............................................................ 1800 / 2935 ( 61%)
............................................................ 1860 / 2935 ( 63%)
............................................................ 1920 / 2935 ( 65%)
............................................................ 1980 / 2935 ( 67%)
............................................................ 2040 / 2935 ( 69%)
............................................................ 2100 / 2935 ( 71%)
............................................................ 2160 / 2935 ( 73%)
............................................................ 2220 / 2935 ( 75%)
............................................................ 2280 / 2935 ( 77%)
............................................................ 2340 / 2935 ( 79%)
............................................................ 2400 / 2935 ( 81%)
............................................................ 2460 / 2935 ( 83%)
............................................................ 2520 / 2935 ( 85%)
............................................................ 2580 / 2935 ( 87%)
............................................................ 2640 / 2935 ( 89%)
............................................................ 2700 / 2935 ( 91%)
............................................................ 2760 / 2935 ( 94%)
............................................................ 2820 / 2935 ( 96%)
......E..................................................... 2880 / 2935 ( 98%)
.......................................................

Time: 15.35 seconds, Memory: 66.00Mb

There were 4 errors:

1) Piwik\Tests\Unit\API\ResponseBuilderTest::test_getResponse_shouldHandleResour
ce
TypeError: Argument 1 passed to PHPUnit_Framework_TestCase::onNotSuccessfulTest(
) must be an instance of Exception, instance of Error given, called in C:\Data\w
ap\htdocs\GitHub\piwik\vendor\phpunit\phpunit\src\Framework\TestCase.php on line
 851

2) Piwik\Plugins\API\tests\Unit\OriginalRendererTest::test_renderResource_should
ReturnTheSameValue
TypeError: Argument 1 passed to PHPUnit_Framework_TestCase::onNotSuccessfulTest(
) must be an instance of Exception, instance of Error given, called in C:\Data\w
ap\htdocs\GitHub\piwik\vendor\phpunit\phpunit\src\Framework\TestCase.php on line
 851

3) Piwik\Plugins\API\tests\Unit\PhpRendererTest::test_renderResource_shouldRetur
nTheSameValue
TypeError: Argument 1 passed to PHPUnit_Framework_TestCase::onNotSuccessfulTest(
) must be an instance of Exception, instance of Error given, called in C:\Data\w
ap\htdocs\GitHub\piwik\vendor\phpunit\phpunit\src\Framework\TestCase.php on line
 851

4) Piwik\Plugins\UserCountry\tests\Unit\UserCountryTest::testGeoIpUpdaterRedunda
ntChecks
rename(C:\Data\wap\htdocs\GitHub\piwik/tests/lib/geoip-files/GeoIPISP.dat,C:\Dat
a\wap\htdocs\GitHub\piwik/tests/lib/geoip-files/GeoIPISP.dat.broken): Der Prozes
s kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet
 wird. (code: 32)

C:\Data\wap\htdocs\GitHub\piwik\plugins\UserCountry\GeoIPAutoUpdater.php:564
C:\Data\wap\htdocs\GitHub\piwik\plugins\UserCountry\tests\Unit\UserCountryTest.p
hp:181
C:\Data\wap\htdocs\GitHub\piwik\plugins\UserCountry\tests\Unit\UserCountryTest.p
hp:92

--

There were 15 failures:

1) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #5 ('http://www.baidu.com/s?ie=gb2...E&ct=0', 'Baidu', 'þ®║Úù┤ ÕÑ¢123
 | µø┤ÕñÜ>>')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Baidu'
-    'keywords' => 'þ®║Úù┤ ÕÑ¢123 | µø┤ÕñÜ>>'
+    'keywords' => '┐§╝õ ║Ò123 | ©³ÂÓ>>'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

2) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #6 ('http://www.baidu.com/s?kw=&sc...%BF%B4', 'Baidu', 'þû»þïéÞ»┤Þï▒Þ
»¡ Õ£¿þ║┐Þºéþ£ï')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Baidu'
-    'keywords' => 'þû»þïéÞ»┤Þï▒Þ»¡ Õ£¿þ║┐Þºéþ£ï'
+    'keywords' => 'ÙÁ¾ó ▀╣¹┐'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

3) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #7 ('http://www.baidu.com/s?wd=%C1...%D4%D8', 'Baidu', 'µÁüÞíîþ¥ÄÞ»¡õ
©ïÞ¢¢')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Baidu'
-    'keywords' => 'µÁüÞíîþ¥ÄÞ»¡õ©ïÞ¢¢'
+    'keywords' => '߸­­ÒÓ¾´´Ô¶°'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

4) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #8 ('http://www.sogou.com/web?quer...191315', 'Sogou', 'õ╝üõ©ÜµÄ¿Õ╣┐'
)
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Sogou'
-    'keywords' => 'õ╝üõ©ÜµÄ¿Õ╣┐'
+    'keywords' => 'õ╝üõ©Üµ×¿Õ╣┐'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

5) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #9 ('http://www.baidu.com/s?ch=14&...dio=on', 'Baidu', 'õ║îÕ║ªÕ«½Úóêþ
│£þâéÞ⢵▓╗ÕÑ¢ÕÉù?')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Baidu'
-    'keywords' => 'õ║îÕ║ªÕ«½Úóêþ│£þâéÞ⢵▓╗ÕÑ¢ÕÉù?'
+    'keywords' => 'õ║£Õ║ªÕ«½Úóêþ│£þâéÞ⢵▓╗ÕÑ¢ÕÉù?'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

6) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #12 ('http://www.yandex.com/yandsea...%D0%B0', 'Yandex', 'Ðçð░ÐüÐéð¥Ð
éð░ ÐÇð░Ðüð┐ð░ð┤ð░...ð║ð╗ð░')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Yandex'
-    'keywords' => 'Ðçð░ÐüÐéð¥Ðéð░ ÐÇð░Ðüð┐ð░ð┤ð░ ÐüÐéðÁð║ð╗ð░'
+    'keywords' => '±ç­░±ü±é­¥±é­░ ±Ç­░±ü­┐­░­┤­░ ±ü±é­Á­║­╗­░'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

7) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #13 ('http://www.yandex.ru/yandsear...%D0%B2', 'Yandex', 'Ðüð┐ð¥ÐÇÐéð
Àð┤ÐÇð░ð▓')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Yandex'
-    'keywords' => 'Ðüð┐ð¥ÐÇÐéðÀð┤ÐÇð░ð▓'
+    'keywords' => '±ü­┐­¥±Ç±é­À­┤±Ç­░­▓'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

8) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #15 ('http://go.mail.ru/search?rch=...%D1%8B', 'Mailru', 'ð│ð╗Ðâð▒ð¥ð
║ð©ðÁ ð╝ð©ð╝ð©ÐçðÁ...ð©ð¢Ðï')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Mailru'
-    'keywords' => 'ð│ð╗Ðâð▒ð¥ð║ð©ðÁ ð╝ð©ð╝ð©ÐçðÁÐüð║ð©ðÁ ð╝ð¥ÐÇÐëð©ð¢Ðï'
+    'keywords' => '­│­╗±â­▒­¥­║­©­Á ­╝­©­╝­©±ç­Á±ü­║­©­Á ­╝­¥±Ç±ë­©­¢±ï'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

9) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wit
h data set #16 ('http://go.mail.ru/search?q=%F...%F8%E8', 'Mailru', 'Ðàð©ð╝Ðüð¥Ð
üÐéð░ð▓ ÐÇð░ÐüÐéð¥...ð┐Ðêð©')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Mailru'
-    'keywords' => 'Ðàð©ð╝Ðüð¥ÐüÐéð░ð▓ ÐÇð░ÐüÐéð¥ÐÇð¥ð┐Ðêð©'
+    'keywords' => '§Þý±¯±‗ÓÔ ­Ó±‗¯­¯´°Þ'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

10) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wi
th data set #79 ('http://image.search.yahoo.co....%BD%8F', 'Yahoo! Japan Images'
, '´¢ö´¢Å ´¢ê´¢à´¢ü´¢Æ´¢ö ´¢î´¢Å´¢ç´¢Å')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Yahoo! Japan Images'
-    'keywords' => '´¢ö´¢Å ´¢ê´¢à´¢ü´¢Æ´¢ö ´¢î´¢Å´¢ç´¢Å'
+    'keywords' => '´¢ö´¢Å ´¢ê´¢à´¢ü´¢Æ´¢ö ´¢£´¢Å´¢ç´¢Å'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

11) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wi
th data set #85 ('http://www.claro-search.com/?...P_clro', 'Claro Search', 'logi
ciels pour ├®crire en jap...ows xp')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Claro Search'
-    'keywords' => 'logiciels pour ├®crire en japonais avec windows xp'
+    'keywords' => 'logiciels pour Ò®crire en japonais avec windows xp'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

12) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wi
th data set #87 ('http://image.search.smt.docom...PT=000', 'Google', 'ÒüÁÒüƒÒéèÒ
ü»ÒâùÒâ¬Òé¡ÒâÑÒéómaxheart')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Google'
-    'keywords' => 'ÒüÁÒüƒÒéèÒü»ÒâùÒâ¬Òé¡ÒâÑÒéómaxheart'
+    'keywords' => 'ÒüÁÒü ÒéÜÒü»ÒâùÒâ¬Òé¡ÒâÑÒéómaxheart'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

13) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wi
th data set #93 ('http://en.toppreise.ch/index....Res=OK', 'Toppreise.ch', 'w├╝r
zpränftß')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Toppreise.ch'
-    'keywords' => 'würzpränftß'
+    'keywords' => 'wÒ╝rzprÒñnftÒ '
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

14) Piwik\Tests\Unit\UrlHelperTest::testExtractSearchEngineInformationFromUrl wi
th data set #105 ('http://www.sputnik.ru/search?...%D0%BE', 'Sputnik', 'ð╝ð©ð║ÐÇ
ð¥')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'name' => 'Sputnik'
-    'keywords' => 'ð╝ð©ð║ÐÇð¥'
+    'keywords' => '­╝­©­║±Ç­¥'
 )

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit\Unit\UrlHelperTest.php:175

15) Piwik\Plugins\API\test\Unit\CsvRendererTest::test_renderScalar_shouldConvert
ToUnicodeByDefault
Failed asserting that 'value
1' starts with " ■".

C:\Data\wap\htdocs\GitHub\piwik\plugins\API\tests\Unit\CsvRendererTest.php:73

FAILURES!
Tests: 2935, Assertions: 5859, Errors: 4, Failures: 15.

C:\Data\wap\htdocs\GitHub\piwik\tests\PHPUnit>^T

@tsteur
Copy link
Member

tsteur commented Sep 23, 2015

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.

@ThaDafinser
Copy link
Contributor

@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

@tsteur
Copy link
Member

tsteur commented Sep 23, 2015

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, composer install should give you the latest PHPUnit version

@mattab mattab added this to the Short term milestone Oct 1, 2015
@Firesphere
Copy link

Seems to be working for me on 2.16 beta 1, no issues discovered yet.

@ghost
Copy link

ghost commented Dec 29, 2015

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?

@hpvd
Copy link

hpvd commented Jan 2, 2016

@manper555: Piwik 2.5.0 is pretty old (2014-08-15) see https://piwik.org/changelog/
maybe you should try updating to 2.15 or latest beta of 2.16

@hpvd
Copy link

hpvd commented Jan 2, 2016

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)
see http://www.php.net/ChangeLog-7.php

@ghost
Copy link

ghost commented Jan 2, 2016

@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.

@hpvd
Copy link

hpvd commented Jan 2, 2016

@manper555: update checker should be working fine in later versions. In settings you can choose update tree: final or beta

@hpvd
Copy link

hpvd commented Feb 3, 2016

just a question:

is there any news on this?
Will 2.16 LTS officially support php 7.0 usage?

If so, it would be great

btw: Are there already any benchmarks done?

@braekling
Copy link

FYI: I switched my personal blog to PHP 7 to test WP-Piwik. Piwik as well as WP-Piwik are working as expected. 😄

@mattab mattab modified the milestones: 2.16.x (LTS), Mid term Apr 11, 2016
@mattab
Copy link
Member Author

mattab commented Apr 11, 2016

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

@hpvd
Copy link

hpvd commented Apr 11, 2016

@braekling and @mattab
Many thanks for this information!

@johnnymast
Copy link

johnnymast commented Apr 24, 2016

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 :octocat:

@tsteur
Copy link
Member

tsteur commented Apr 25, 2016

Thanks for sharing @johnnymast 👍

@mattab mattab changed the title PHP7 compatibility for Piwik Full PHP7 compatibility and automated PHP7 testing for Piwik May 27, 2016
@mattab mattab added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Jul 8, 2016
@mattab
Copy link
Member Author

mattab commented Jul 14, 2016

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 👍

@mattab
Copy link
Member Author

mattab commented Jul 14, 2016

Here are the commands I used to upgrade to PHP7 on Ubuntu on Apache 2.4:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-mysql  libapache2-mod-php7.0 php7.0-mysql php7.0-curl  php7.0-gd php7.0-json  php7.0-mbstring
sudo /etc/init.d/apache2 restart
sudo a2enmod php7.0
sudo a2dismod php5
sudo /etc/init.d/apache2 restart

@mattab
Copy link
Member Author

mattab commented Jul 14, 2016

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.*

@mattab mattab closed this as completed Jul 14, 2016
@mattab mattab modified the milestones: 2.16.2, 2.16.x (LTS) Jul 14, 2016
@mattab mattab changed the title Full PHP7 compatibility and automated PHP7 testing for Piwik Full PHP7 compatibility Jul 15, 2016
@sercanl
Copy link

sercanl commented Dec 19, 2018

this post may help for future php migration issues:
https://storksnestblog.wordpress.com/2018/12/19/php-7-migration-challenges-and-fix-tips/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests