Skip to content

Warning after cron job execution "Notice: Undefined index: HTTP_HOST in pec.php..."

You can set the HTTP_HOST in pec.php if you are running with PHP CLI.

if ( defined( 'WP_CLI' ) && WP_CLI ) {
    $_SERVER['HTTP_HOST'] = 'yourdomain.com';
}

Feedback and Knowledge Base