• Resolved schroederskater

    (@schroederskater)


    Hi all,

    I tried to set up a cron job and when testing wp-cron.php manually I get this error:

    PHP Warning: Undefined array key “HTTP_HOST” in …/ms-settings.php on line 57

    Can someone please give me a hint?

    PHP 8.0, WP 5.9.3

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    How did you schedule a WP cron event and what did you do to manually test? It seems like there’s a server mis-configuration for HTTP_HOST to not be defined, but that section of code appears to only come into play if the request did not cause the WP environment to be properly initialized.

    Thread Starter schroederskater

    (@schroederskater)

    Hi @bcworkz,

    Thanks for answering!

    I used this command for testing and the cron job:

    /usr/bin/php80 /home/sites/22b/5/519ae1e894/eurocomp.info/wp-cron.php

    I’m running two different domains on this hosting service and they both show this warning. Andreas, if this is very difficult to diagnose I can go back to WPs default setting to call wp-cron. All sites are running without any problem.

    Moderator bcworkz

    (@bcworkz)

    As a php command from terminal? That takes Apache out of the picture, so the usual HTTP system values are not set. If you want to trigger WP cron, just request wp-cron.php from a web browser so Apache gets involved. There’s normally no need. Calling wp-cron.php will not accomplish anything unless a event is scheduled to run, but hasn’t yet run. If something is scheduled to run and hasn’t yet run, making any WP request will trigger WP cron anyway.

    Thread Starter schroederskater

    (@schroederskater)

    Thank you for this explanation!

    And have a nice weekend!
    Thomas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Undefined array key “HTTP_HOST” in ms-settings.php’ is closed to new replies.