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

Support PHP 8.3 in local development #114

Open
bobbingwide opened this issue Dec 3, 2023 · 12 comments
Open

Support PHP 8.3 in local development #114

bobbingwide opened this issue Dec 3, 2023 · 12 comments

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Dec 3, 2023

A follow on to #103, which was for PHP 8.2, and PHP 8.1

PHP 8.3.0 https://www.php.net/releases/8.3/en.php was released on 23rd November 2023

Most of my live sites are currently running PHP 7.4.33, which is well out of support, but is the default version of PHP in the hosting offered by SiteGround. I've raised an issue to update the live sites to PHP 8.2, or PHP 8.1. See #113

Now it's time to test and/or update my plugins and themes for PHP 8.3
I hope it's not another horrendous time waster

@bobbingwide
Copy link
Owner Author

Requirement

  • Upgrade to PHP 8.3 in my local development environment
  • Enable switching between PHP versions: 8.0, 8.1, 8.2 and 8.3
  • Test WordPress plugins and themes and fix where necessary.

Proposed solution

@bobbingwide
Copy link
Owner Author

That appeared to be quite easy.

Demonstrating PHP version

C:\php>php -v
PHP 8.3.0 (cli) (built: Nov 21 2023 17:48:31) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.3.0, Copyright (c) Zend Technologies

Testing oik-user

C:\apache\htdocs\wordpress\wp-content\plugins\oik-user>pu
C:\apache\htdocs\phpLibraries\phpunit\phpunit-9.6.12.phar
Searching for wp-config.php in directories leading to: C:\apache\htdocs\wordpress\wp-content\plugins\oik-user
Found wp-config.php in: C:\apache\htdocs\wordpress/
oik-wp running WordPress 6.4.1
C:\apache\htdocs\wordpress\wp-content\plugins\oik-user
cli
Using wordpress-develop-tests plugin
PHPUnit 9.6.12 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.0
Configuration: C:\apache\htdocs\wordpress\wp-content\plugins\oik-user\phpunit.xml.dist

......                                                              6 / 6 (100%)

Time: 00:00.476, Memory: 112.00 MB

OK (6 tests, 6 assertions)

@bobbingwide
Copy link
Owner Author

Well that was well wacky. When I switched to PHP 8.3 in the webserver and ran phpinfo() I got this

[04-Dec-2023 11:38:40 UTC] PHP Fatal error:  Maximum call stack size of 18446744073709514752 bytes 
reached during compilation. Try splitting expression in C:\apache\htdocs\bw\phpinfo.php on line 2

The source code was

<?php
 phpinfo();

@bobbingwide
Copy link
Owner Author

I've had a few more since then
Latest was

Fatal error: Maximum call stack size of 18446744073709514752 bytes 
reached during compilation. Try splitting expression in C:\apache\htdocs\wordpress\index.php on line 14

Line 14 is

define( 'WP_USE_THEMES', true );

@bobbingwide
Copy link
Owner Author

bobbingwide commented Dec 10, 2023

Message displayed visiting https://s.b/bwcom/top-10-wp-plugins/

Deprecated: Calling get_class() without arguments is deprecated in C:\apache\htdocs\bwcom\wp-includes\class-wp-http.php on line 329

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php(286:2) bw_trace_error_handler(1) 193 9 2023-12-10T10:34:48+00:00 2.200010 0.121214 cf=admin_init 10677 61 0 77594624/77594624 256M F=1242 err Array

[0] => (integer) 8192
[1] => (string) "Deprecated: Calling get_class() without arguments is deprecated"
[2] => (string) "C:\apache\htdocs\bwcom\wp-includes\class-wp-http.php"
[3] => (integer) 329
0. bw_lazy_backtrace C:\apache\htdocs\wordpress\wp-content\plugins\oik-lib\libs\bwtrace.php:108 0
1. bw_backtrace C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php:293 0
2. bw_trace_error_handler(8192,Calling get_class() without arguments is deprecated,C:\apache\htdocs\bwcom\wp-includes\class-wp-http.php,329) C:\apache\htdocs\bwcom\wp-includes\class-wp-http.php:329 4
3. request(https://jetpack.wordpress.com/jetpack.test/1/,array) C:\apache\htdocs\bwcom\wp-includes\class-wp-http.php:634 2
4. get(https://jetpack.wordpress.com/jetpack.test/1/,array) C:\apache\htdocs\bwcom\wp-includes\http.php:168 2
5. wp_remote_get(https://jetpack.wordpress.com/jetpack.test/1/) C:\apache\htdocs\wordpress\wp-content\plugins\jetpack\class.jetpack.php:5013 1
6. permit_ssl C:\apache\htdocs\wordpress\wp-content\plugins\jetpack\class.jetpack.php:3347 0
7. admin_init() C:\apache\htdocs\bwcom\wp-includes\class-wp-hook.php:310 1
8. apply_filters(null,array) C:\apache\htdocs\bwcom\wp-includes\class-wp-hook.php:334 2
9. do_action(array) C:\apache\htdocs\bwcom\wp-includes\plugin.php:517 1
10. do_action(admin_init) C:\apache\htdocs\bwcom\wp-admin\admin.php:175 1
11. require_once(C:\apache\htdocs\bwcom\wp-admin\admin.php) C:\apache\htdocs\bwcom\wp-admin\index.php:10 1

Analysis

@bobbingwide
Copy link
Owner Author

Deprecated: Function libxml_disable_entity_loader() is deprecated in C:\apache\htdocs\wp55\wp-content\plugins\wordpress-importer\parsers\class-wxr-parser-simplexml.php on line 21

produced in WordPress importer
https://s.b/wp55/tt4/wp-admin/admin.php?import=wordpress&step=1&_wpnonce=8316030922

@bobbingwide
Copy link
Owner Author

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\apache\htdocs\hm\wp-content\plugins\gpt3-ai-content-generator\admin\extra\wpaicg_image_generator_log.php on line 27

@bobbingwide
Copy link
Owner Author

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\helpers\first-time-configuration-notice-helper.php on line 127

Yoast SEO was 21.5. Try again with the latest

@bobbingwide
Copy link
Owner Author

Let's see if the Fatal error stack problem's been fixed with PHP 8.3.3
Downloaded: php-8.3.3-Win32-vs16-x64.zip

C:\>php -v
PHP 8.3.3 (cli) (built: Feb 13 2024 23:17:12) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies

@bobbingwide
Copy link
Owner Author

bobbingwide commented Feb 17, 2024

Nope.

Fatal error: Maximum call stack size of 18446744073709518848 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached during compilation. Try splitting expression in C:\apache\htdocs\bigram\wp-admin\post.php on line 12

There's some documentation at https://www.php.net/manual/en/migration83.other-changes.php
But it doesn't help.

I'm trying with a value of 128M for max_allowed_stack_size but have no idea if that makes any sense.
There's another value of -1 (no limit) which I might try later.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Apr 20, 2024

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated 
in C:\apache\htdocs\wp-a2z\wp-includes\html-api\class-wp-html-tag-processor.php on line 544

Looks like I'd already started debugging this in s.b/wp55

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php(581:0) bw_trace_attached_hooks(3) 154 0 2024-04-20T14:10:48+00:00 3.080374 0.000246 cf=wp_head,wpseo_head,wpseo_adjacent_rel_url 30425 103 2021 60817408/62914560 256M F=1122 wpseo_adjacent_rel_url 
: 0   bw_trace_parms;9 bw_trace_attached_hooks;9
: 1   Yoast\WP\SEO\Integrations\Front_End_Integration::adjacent_rel_url;3
C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php(286:2) bw_trace_error_handler(1) 155 1 2024-04-20T14:10:48+00:00 3.080637 0.000263 cf=wp_head,wpseo_head,wpseo_adjacent_rel_url 30432 103 2021 60817408/62914560 256M F=1122 err Array

    [0] => (integer) 8192
    [1] => (string) "Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated"
    [2] => (string) "C:\apache\htdocs\wp55\wp-includes\html-api\class-wp-html-tag-processor.php"
    [3] => (integer) 544

0. bw_lazy_backtrace C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\libs\bwtrace.php:108 0
1. bw_backtrace C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php:293 0
2. bw_trace_error_handler(8192,strlen(): Passing null to parameter #1 ($string) of type string is deprecated,C:\apache\htdocs\wp55\wp-includes\html-api\class-wp-html-tag-processor.php,544) C:\apache\htdocs\wp55\wp-includes\html-api\class-wp-html-tag-processor.php:544 4
3. next_tag(array) C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\integrations\front-end-integration.php:328 1
4. adjacent_rel_url(,prev,object) C:\apache\htdocs\wp55\wp-includes\class-wp-hook.php:324 3
5. apply_filters(,array) C:\apache\htdocs\wp55\wp-includes\plugin.php:205 2
6. apply_filters(wpseo_adjacent_rel_url,,prev,object) C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\presenters\rel-prev-presenter.php:70 4
7. get C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\presenters\abstract-indexable-tag-presenter.php:37 0
8. present C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\presenters\rel-prev-presenter.php:39 0
9. present C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\integrations\front-end-integration.php:406 0
10. present_head() C:\apache\htdocs\wp55\wp-includes\class-wp-hook.php:324 1
11. apply_filters(,array) C:\apache\htdocs\wp55\wp-includes\class-wp-hook.php:348 2
12. do_action(array) C:\apache\htdocs\wp55\wp-includes\plugin.php:517 1
13. do_action(wpseo_head) C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\src\integrations\front-end-integration.php:377 1
14. call_wpseo_head() C:\apache\htdocs\wp55\wp-includes\class-wp-hook.php:324 1
15. apply_filters(null,array) C:\apache\htdocs\wp55\wp-includes\class-wp-hook.php:348 2
16. do_action(array) C:\apache\htdocs\wp55\wp-includes\plugin.php:517 1
17. do_action(wp_head) C:\apache\htdocs\wp55\wp-includes\general-template.php:3052 1
18. wp_head C:\apache\htdocs\wp55\wp-includes\template-canvas.php:17 0
19. include(C:\apache\htdocs\wp55\wp-includes\template-canvas.php) C:\apache\htdocs\wp55\wp-includes\template-loader.php:106 1
20. require_once(C:\apache\htdocs\wp55\wp-includes\template-loader.php) C:\apache\htdocs\wp55\wp-blog-header.php:19 1
21. require(C:\apache\htdocs\wp55\wp-blog-header.php) C:\apache\htdocs\wp55\index.php:17 1

@bobbingwide
Copy link
Owner Author

bobbingwide commented Apr 20, 2024

Looks like I'd already started debugging this in s.b/wp55

Yup see #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant