I am trying to execute WordPress cron but getting an error.
Command Executed:
/usr/bin/php7.1-sp /srv/users/serverpilot/apps/myapp/public/wp-cron.php
Errors:
PHP Notice: Undefined index: HTTPS in /srv/users/serverpilot/apps/myapp/public/wp-config.php
PHP Notice: Undefined index: HTTP_HOST in /srv/users/serverpilot/apps/myapp/public/wp-config.php
My wp-config file:
define('SP_REQUEST_URL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', SP_REQUEST_URL);
define('WP_HOME', SP_REQUEST_URL);
I have tried searching and replacing code but it doesn't work. the only solution I got is to manually define the URL.