PHP Errors when running wpcron.php via Cronjob

[ad_1]

Hello,

my server runs at PHP 8.1 now and since then I get these errors:

Warning: Undefined array key “HTTP_HOST” in /<path to wordpress>/wp-content/plugins/ip2location-country-blocker/ip2location-country-blocker.php on line 2960

Warning: Trying to access array offset on value of type bool in /<path to wordpress>//wp-content/plugins/ip2location-country-blocker/ip2location-country-blocker.php on line 2970

I am running wpcron.php via a cron job to avoid waiting for a visitor triggering the wordpress cronjobs (and I would like to keep that method). I guess because of this I get the errors ? (I had the same with a self written script). It help (at least for the HTTP_HOST) to check if value is set before using it.

wpcron.php is called with php /path/to/wpcron.php

Could you please have a look into it ? Thanks in a advance.

Dragon013

  • This topic was modified 4 hours, 20 minutes ago by dragon013.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer