easysoft / phpmicro

micro sfx SAPI for php
Apache License 2.0
257 stars 30 forks source link

Fix opcache patch for PHP 8.3.11+ and 8.2.23+ #18

Closed mpociot closed 2 months ago

mpociot commented 3 months ago

PHP 8.3.11 (and 8.2.23) changed these lines in their ext/opcache/config.m4 which leads to issues that the patch file can not be applied.

https://github.com/php/php-src/compare/php-8.3.10...php-8.3.11#diff-fba8aed1e512099e6635bd4d9ffd939e0489105bc6b2c68d0bfe1abb0ee1007cR322

This PR fixes the patch file for PHP 8.3 - but there are some things missing where I could use your help:

Please note that I'm not using phpmicro directly, but via static-php-cli. Also see this issue https://github.com/crazywhalecc/static-php-cli/issues/527

dixyes commented 3 months ago

I always assume patches is for latest releases, so just update it. If necessary, add a note in readme.

As for 8.2, we may need another patch file.

mpociot commented 3 months ago

Okay, then I think @crazywhalecc needs to see how he wants to solve PHP backwards compatibility inside static-php-cli.

Regarding the fact that with the new patch, opcache is not working as expected, I'm not sure if that's an issue in micro or the static-php codebase.

crazywhalecc commented 3 months ago

The changes I can think of at the moment are:

  1. Use patch only when including the opcache extension, and modify the PHP source code as needed
  2. For breaking changes minor ver of php-src, if we do not consider modifying phpmicro's fallback method, maybe we can only copy these patch files to the static-php-cli repository and apply them according to the specific version num.
  3. ~If we consider modifying the fallback strategy, it may be feasible to directly use PHP_VERSION_ID as the patch suffix.~

EDIT: don't need to consider old version of php-src.

mpociot commented 2 months ago

I just updated the PR with the PHP 8.2 patch provided by @crazywhalecc Nevermind the issue I had with opcache not being correctly enabled, it was an error on my end. Sorry about that!

I think this is good to go from my side then