{"id":9672066,"date":"2017-11-11T00:13:08","date_gmt":"2017-11-11T00:13:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/problem-with-cron-when-run-directly-by-php\/"},"modified":"2017-11-11T00:13:08","modified_gmt":"2017-11-11T00:13:08","slug":"problem-with-cron-when-run-directly-by-php","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/problem-with-cron-when-run-directly-by-php\/","title":{"rendered":"Problem with cron when run directly by php"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I am running wp-cron.php directly by php as follows in a cron job:<\/p>\n<p>  php &lt;path_to_wordpress&gt;\/wp-cron.php<\/p>\n<p>I see the following PHP notice:<\/p>\n<pre><code>[11-Nov-2017 00:08:02 UTC] PHP Notice:  Undefined index: HTTP_HOST in ...\/wp-content\/plugins\/merge-minify-refresh\/merge-minify-refresh.php on line 102\n[11-Nov-2017 00:08:02 UTC] PHP Stack trace:\n[11-Nov-2017 00:08:02 UTC] PHP   1. {main}() ...\/wp-cron.php:0\n[11-Nov-2017 00:08:02 UTC] PHP   2. require_once() ...\/wp-cron.php:26\n[11-Nov-2017 00:08:02 UTC] PHP   3. require_once() ...\/wp-load.php:37\n[11-Nov-2017 00:08:02 UTC] PHP   4. require_once() ...\/wp-config.php:126\n[11-Nov-2017 00:08:02 UTC] PHP   5. include_once() ...\/wp-settings.php:303\n[11-Nov-2017 00:08:02 UTC] PHP   6. MergeMinifyRefresh-&gt;__construct() ...\/wp-content\/plugins\/merge-minify-refresh\/merge-minify-refresh.php:801<\/code><\/pre>\n<p>I am guessing the plugin is expected HTTP_HOST to be defined, but it is not when wp-cron.php is called directly by php.<\/p>\n","protected":false},"template":"","class_list":["post-9672066","topic","type-topic","status-publish","hentry","topic-tag-cron","topic-tag-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9672066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9672066\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9672066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}