Title: Undefined array key &#8220;SERVER_PROTOCOL&#8221; when running Cron
Last modified: March 23, 2023

---

# Undefined array key “SERVER_PROTOCOL” when running Cron

 *  Resolved [droixstore](https://wordpress.org/support/users/droixstore/)
 * (@droixstore)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/undefined-array-key-server_protocol-when-running-cron/)
 * After installing Weglot I have started getting error message while running cron:
 * I get following error message when runnin cron PHP Warning: Undefined array key“
   SERVER_PROTOCOL” in /var/www/vhosts/droix.net/httpdocs/wp-content/plugins/weglot/
   vendor/weglot/weglot-php/src/Util/Server.php on line 122 PHP Warning: Undefined
   array key “SERVER_PROTOCOL” in /var/www/vhosts/droix.net/httpdocs/wp-content/
   plugins/weglot/vendor/weglot/weglot-php/src/Util/Server.php on line 122 PHP Warning:
   Undefined array key “SERVER_PROTOCOL” in /var/www/vhosts/droix.net/httpdocs/wp-
   content/plugins/weglot/vendor/weglot/weglot-php/src/Util/Se…
 * after providing a default value for SERVER_PROTOCOL issue seems to be gone, however
   I would like your support to look into it and include that fix in future releases
 * public static function getProtocol(array $server)
   {$protocol = isset($server[‘
   SERVER_PROTOCOL’]) ? strtolower($server[‘SERVER_PROTOCOL’]) : ‘http’;return substr(
   $protocol, 0, strpos($protocol, ‘/’)) . (self::isSsl($server) ? ‘s’ : ”);}
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-array-key-server_protocol-when-running-cron%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Edson Galina Fortes](https://wordpress.org/support/users/glx77/)
 * (@glx77)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/undefined-array-key-server_protocol-when-running-cron/#post-16591270)
 * hi [@droixstore](https://wordpress.org/support/users/droixstore/) ,
 * thanks for your feedbacks, the issue will be fix on our next release
   Regards

Viewing 1 replies (of 1 total)

The topic ‘Undefined array key “SERVER_PROTOCOL” when running Cron’ is closed to
new replies.

 * ![](https://ps.w.org/weglot/assets/icon-256x256.gif?rev=3333666)
 * [Translate WordPress with Weglot - Multilingual AI Translation](https://wordpress.org/plugins/weglot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/weglot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/weglot/)
 * [Active Topics](https://wordpress.org/support/plugin/weglot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/weglot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/weglot/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Edson Galina Fortes](https://wordpress.org/support/users/glx77/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/undefined-array-key-server_protocol-when-running-cron/#post-16591270)
 * Status: resolved