-3

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.

Daniyal Nasir
  • 669
  • 7
  • 22
Merlin M
  • 3
  • 3

1 Answers1

0

Can you define a new value for the home url. Something line below

define('SP_REQUEST_URL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
define('SP_REQUEST_URL_HOME', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);

define('WP_SITEURL', SP_REQUEST_URL);
define('WP_HOME', SP_REQUEST_URL_HOME);

Thanks, Raghava

Masivuye Cokile
  • 4,754
  • 3
  • 19
  • 34