[wp-trac] [WordPress Trac] #34353: redirect_canonical() – Undefined indexes 'host' and 'scheme'
WordPress Trac
noreply at wordpress.org
Thu Aug 28 20:36:38 UTC 2025
#34353: redirect_canonical() – Undefined indexes 'host' and 'scheme'
--------------------------------------+-----------------------------
Reporter: theamila | Owner: (none)
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Future Release
Component: Canonical | Version: 4.3.1
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Comment (by mikemeinz):
Thnks but not using nginx + php-fpm.
Replying to [comment:72 Mayhem30]:
> Replying to [comment:71 mikemeinz]:
> > Fairly frequently, seeing these warnings in the PHP error_log.
> > This ticket is 10 years old????
> > Is there any estimate of when canonical.php will be updated to prevent
these warnings?
> >
> > {{{
> > [23-Aug-2025 01:17:57 UTC] PHP Warning: Undefined array key "host" in
/home/www/public_html/wp-includes/canonical.php on line 717
> > [23-Aug-2025 01:17:57 UTC] PHP Warning: Undefined array key "host" in
/home/www/public_html/wp-includes/canonical.php on line 728
> > [23-Aug-2025 01:17:57 UTC] PHP Warning: Undefined array key "host" in
/home/www/public_html/wp-includes/canonical.php on line 731
> > }}}
> >
> >
> > {{{
> > [14-Aug-2025 19:23:52 UTC] PHP Warning: Undefined array key "scheme"
in /home/www/public_html/wp-includes/canonical.php on line 752
> > }}}
> >
> >
> > PHP 8.3
> > WordPress 6.8.2
>
>
> If you are using nginx + php-fpm, you can fix it by adding these to your
php-fpm.conf file:
>
>
> {{{
> fastcgi_param HOST $server_name;
> fastcgi_param HTTP_HOST $server_name;
> fastcgi_param SCHEME $scheme;
> }}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34353#comment:73>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list