• Resolved ataschus

    (@ataschus)


    Hi,

    when running cron task through wp-cli (“wp-cli cron event run –due-now”) PHP throws a warning for wpcf7-redirect/classes/class-wpcf7r-updates.php line 40.

    Here you try to use $_SERVER[‘HTTP_HOST’] which is not defined, when run in the CLI.

    One possible solution could be to use


    $this->domain = isset($_SERVER[‘HTTP_HOST’]) ? $_SERVER[‘HTTP_HOST’] : (string)parse_url(get_option(‘siteurl’), PHP_URL_HOST);

    if $_SERVER[‘HTTP_HOST’] is important for any reason.

    Probably the code can be completely removed in the free version, it seems only to be relevant for the pro version?

    Greets,

    Axel

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘PHP Warning when running cron through wp-cli’ is closed to new replies.