the-benchmarker / web-frameworks

Which is the fastest web framework?
MIT License
6.91k stars 641 forks source link

[PHP] Upgrade to 8.0 #3655

Closed waghanza closed 2 years ago

waghanza commented 3 years ago

Hi,

This PR replaces #3606, it upgrade PHP to 8.0

Regards,

waghanza commented 3 years ago

@dominikzogg seems that a dependency of yours is not PHP 8 compatible https://the-benchmarker.semaphoreci.com/jobs/140d85e3-528c-4227-b829-195cae815911 in https://github.com/chubbyphp/chubbyphp-swoole-request-handler/blob/af4e8c91e9897fa49e0e530b188daa22c26e814f/composer.json#L22

dominikzogg commented 3 years ago

@waghanza as i can see, you already saw the open PR: https://github.com/dflydev/dflydev-fig-cookies/pull/39

dominikzogg commented 3 years ago

@waghanza the dependency that was not ready for php 8 (dflydev/dflydev-fig-cookies) is ready now, means the chubbyphp-swoole and slim-swoole should run on php8

waghanza commented 3 years ago

let see what's CI say

dominikzogg commented 3 years ago

@waghanza it seems that the newly added libevent does not work (all workerman stuff fails)

waghanza commented 3 years ago

You mean event php module configured in https://github.com/the-benchmarker/web-frameworks/blob/eb5479f3ca32f0a085b528e900405c089b5766f8/php/chubbyphp-workerman/config.yaml#L1

I though this module was required on production

dominikzogg commented 3 years ago

@waghanza it's much better with the extension (from what I read) but it seems to fail compiling

waghanza commented 3 years ago

@waghanza it's much better with the extension (from what I read) but it seems to fail compiling

And idea @walkor ?

As I can see event has php8 support https://pecl.php.net/package-changelog.php?package=event&release=3.0.2

@dominikzogg see that an outdate version of event is used https://github.com/the-benchmarker/web-frameworks/runs/1753805064?check_suite_focus=true#step:6:975, I'll open an issue

laylatichy commented 3 years ago

@waghanza it's much better with the extension (from what I read) but it seems to fail compiling

And idea @walkor ?

As I can see event has php8 support https://pecl.php.net/package-changelog.php?package=event&release=3.0.2

@dominikzogg see that an outdate version of event is used https://github.com/the-benchmarker/web-frameworks/runs/1753805064?check_suite_focus=true#step:6:975, I'll open an issue

@waghanza pecl and pear are not available in php8 by default - see https://externals.io/message/103977

instead of pecl install xxx you have to run

mkdir -p /usr/src/php/ext/xxx && curl -fsSL https://pecl.php.net/get/xxx | tar xvz -C "/usr/src/php/ext/xxx" --strip 1 && docker-php-ext-install xxx \

waghanza commented 3 years ago

pecl and pear are not available in php8

However I have access to this command on php8 containers

@dominikzogg Having an non-compatible extension is 🆗 since PHP 8 event is still in beta. We have to wait

laylatichy commented 3 years ago

pecl and pear are not available in php8

However I have access to this command on php8 containers

@dominikzogg Having an non-compatible extension is 🆗 since PHP 8 event is still in beta. We have to wait

yes, but as you can see - /tmp/pear/temp/event/php7 - php7 pear, not 8, so that's why it's grabbing event for a php7 not v3

php8-pear is in community repo on alpine https://pkgs.alpinelinux.org/packages?name=php8-pear&branch=edge

btw workerman will work without event, I disabled it in my nano due to php8 pecl shenanigan's ;p will add it later on as well

walkor commented 3 years ago

@waghanza try command pecl install event-3.0.2 instead of pecl install event.

waghanza commented 3 years ago

@waghanza try command pecl install event-3.0.2 instead of pecl install event.

It's working, but I prefer avoid this. I think the only solution is to wait

waghanza commented 3 years ago

Thanks @laylatichy. I've made a little fix to containers definitions, so as pecl for php8 is used.

The changes is in php core, and seems not to be temp : https://github.com/php/php-src/pull/3781

However, I'm a little bit confused about this : a C based extension should not be installed with https://github.com/FriendsOfPHP/pickle in php8 ?

laylatichy commented 3 years ago

Thanks @laylatichy. I've made a little fix to containers definitions, so as pecl for php8 is used.

The changes is in php core, and seems not to be temp : php/php-src#3781

However, I'm a little bit confused about this : a C based extension should not be installed with https://github.com/FriendsOfPHP/pickle in php8 ?

pickle last time I checked was still in a bit of beta state, we still have to wait for some frameworks here that use laminas deps for example so maybe it'll be ready by then

waghanza commented 3 years ago

seems that pickle is ready to be used @laylatichy

huangzhhui commented 3 years ago

Hyperf still does not support PHP 8 yet, still waiting an indispensable package Roave/BetterReflection to support PHP 8

mruz commented 3 years ago

@ice isn't ready yet https://github.com/ice/framework/pull/290, waiting for https://github.com/phalcon/zephir/issues/2111.

Jeckerson commented 3 years ago

Phalcon is also waiting for https://github.com/phalcon/zephir/issues/2111

waghanza commented 3 years ago

@Jeckerson I though phalcon was in rewrite (in pure php)

waghanza commented 3 years ago

@luoxiaojun1992 CI seems to pass (for sw-fw-less), but https://github.com/the-benchmarker/web-frameworks/pull/3655/checks?check_run_id=1772074108#step:6:3781 seems weird

Jeckerson commented 3 years ago

@waghanza Currently we will make both: as extension (v4.2) and as PHP native (v5.0) both with PHP8.0 support. To make sure that transition is smooth and look at benchmarks and performance differences.

mruz commented 3 years ago

@waghanza can you try ice 1.8.0alpha2?

waghanza commented 3 years ago

@lizhichao For one-fpm I have

ERROR|2021-02-13 08:26:58|1|/usr/src/app/vendor/lizhichao/one/src/helper.php:314|{"file":"\/usr\/src\/app\/vendor\/lizhichao\/one\/src\/Http\/Router.php:171","msg":"Class \"App\\Controllers\\IndexController\" not found","code":0,"trace":[{"file":"\/usr\/src\/app\/App\/index.php","line":23,"function":"One\\Http\\{closure}","class":"One\\Http\\Router","type":"->","args":[]},{"file":"\/usr\/src\/app\/public\/index.php","line":2,"args":["\/usr\/src\/app\/App\/index.php"],"function":"require"}]}

in log files


SOLVED

Was a merging issue -> composer.json malformed

waghanza commented 3 years ago

@walkor webman is failing on php 8, but not on master

waghanza commented 3 years ago

@waghanza can you try ice 1.8.0alpha2?

I have

Warning: PHP Startup: Unable to load dynamic library 'ice.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so: backtrace_symbols: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so: No such file or directory)) in Unknown on line 0

when running php -m @mruz

walkor commented 3 years ago

@walkor webman is failing on php 8, but not on master.

@waghanza It seems to be the same issue as this one #3921 .

waghanza commented 3 years ago

@walkor webman is failing on php 8, but not on master.

@waghanza It seems to be the same issue as this one #3921 .

I thought, but seems not to be the case

The specs are failing on this branch, but not on master

waghanza commented 3 years ago

@mruz ice is compilable, but failing at https://github.com/the-benchmarker/web-frameworks/pull/3655/checks?check_run_id=1917181803

ℹī¸ Please note that I had to remove composer version check, since ice 1.8 is still in alpha

waghanza commented 3 years ago

Do you mind PR @mruz, to fix ice here ?

waghanza commented 3 years ago

Hi,

any PHP guy with enough bandwidth to help @Ocramius in https://github.com/Roave/BetterReflection/issues/701#issuecomment-808730577 ?

Regards,

/cc @limingxinleo @huangzhhui

limingxinleo commented 3 years ago

Sorry I don't have the enough time.

😭😭😭

waghanza commented 3 years ago

Wen setup the last 1.8.0 mkdir -p /usr/src/php/ext/ice && curl -fsSL https://pecl.php.net/get/ice | tar xvz -C "/usr/src/php/ext/ice" --strip 1, I have

Warning: PHP Startup: Unable to load dynamic library 'ice.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so: backtrace_symbols: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so: No such file or directory)) in Unknown on line 0

@mruz

waghanza commented 3 years ago

I've successfully issued your suggestion https://github.com/ice/framework/pull/298#issuecomment-823059764 @mruz

see https://the-benchmarker.semaphoreci.com/jobs/52aaf9ce-7d8f-4a18-ab7d-c8f11f08bb65

limingxinleo commented 2 years ago

hyperf2.2 already support php8

waghanza commented 2 years ago

We should have been noticed by renovatebot. Could you make a PR @limingxinleo ?

limingxinleo commented 2 years ago

@waghanza https://github.com/the-benchmarker/web-frameworks/pull/4477

waghanza commented 2 years ago

@leocavalcante @sy-records I have finished this feature (I have to include hyperf beta and phalcon alpha to unblock this PR). May you quick review this ?

waghanza commented 2 years ago

https://the-benchmarker.semaphoreci.com/jobs/96c44ec8-afd0-4f94-95f6-96ef864c70d5#L4168 @limingxinleo

waghanza commented 2 years ago

@niden @leocavalcante @sy-records @laylatichy any idea about https://the-benchmarker.semaphoreci.com/jobs/e95a758b-481a-4311-973c-bef31558de32#L47191 ?

phalcon extension seems not load

Jeckerson commented 2 years ago

@waghanza This occur due missing header, will be fixed in next version.

https://github.com/phalcon/cphalcon/pull/15610/files#diff-90ad24223200fd3ab4bdd6b25c2264b1339b2f6693b8c4b3b869c0ff03cbb5a5R54

waghanza commented 2 years ago

@sy-records @leocavalcante @laylatichy @dominikzogg finally ... this PR is ready and CI is OK

the only think is that I use phalcon alpha @Jeckerson

thanks for your awesome contributions to all 🎉