You’re getting Undefined index
errors because you’re loading the files directly and not rendered through the server. The server typically populates those values and it’s actually more secure to run with less elevated privileges (through an HTTP
request).
Throw your manual cron to a curl
or wget
— whichever you have installed on your server.
curl -s -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64)" http://YourWebsiteURL.com/wp-cron.php?doing_wp_cron
OR
wget -O /dev/null http://www.YourWebsiteURL.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
This should trigger your cron
and with www
privileges instead of server root
access.