WordPress 4.8 PHP 8.3

WordPress 4.8.24 PHP 8.3.3

__autoload() is no longer supported

PHP Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in /var/www/html/wp-includes/compat.php on line 502

// SPL can be disabled on PHP 5.2
if ( ! function_exists( 'spl_autoload_register' ) ):
...
endif;

if~endif; を削除

I fixed it replacing:

function __autoload( $classname ) {
    ...
}

by

function spl_autoload_register( $classname ) {
    ...
}

https://github.com/dzuelke/wordpress-12factor/issues/4

Call to undefined function create_function()

PHP Fatal error: Uncaught Error: Call to undefined function create_function() in /var/www/html/wp-includes/pomo/translations.php:208

wp-includes/pomo/plural-forms.php を導入

https://github.com/WordPress/WordPress/commit/0a3b7d8e31def538cf531791efe8bf33e6e243cc

Call to undefined function get_magic_quotes_gpc()

wp-includes/formatting.php
wp-includes/load.php

get_magic_quotes_gpc() を使ってる部分をコメントアウトする(3箇所)


wp-cli 動くようになる

404

wp-includes/class-wp-query.php

The kernel has a method that is called at each request: \WP_Query::parse_query. It contains the lines

if ( ! is_scalar( $qv['p'] ) || $qv['p'] < 0 ) {
 $qv['p'] = 0;
 $qv['error'] = '404';
  ...

In most cases $qv['p'] contains an empty line, which causes if to trigger and set the 404 error.
In WordPress 5.6 the comparison line looks like this:

if ( ! is_scalar( $qv['p'] ) || (int) $qv['p'] < 0 ) {

This fixes the problem in PHP 8 and works correctly in all versions of PHP.

Why WordPress 5.5.3 with PHP 8 shows 404 on every page? - KAGG