From: Andrew Dolgov Date: Thu, 6 Feb 2014 19:03:05 +0000 (+0400) Subject: detect php cgi binary because people keep trying to run service scripts using it X-Git-Tag: 1.12~56 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=6f61ba46c4a7d61c8e90252897b711573bbb36cc detect php cgi binary because people keep trying to run service scripts using it --- diff --git a/update.php b/update.php index c1547fa7..521b956a 100755 --- a/update.php +++ b/update.php @@ -42,6 +42,13 @@ $options = getopt("", $longopts); + if (!is_array($options)) { + die("error: getopt() failed. ". + "Most probably you are using PHP CGI to run this script ". + "instead of required PHP CLI. Check tt-rss wiki page on updating feeds for ". + "additional information.\n"); + } + if (count($options) == 0 && !defined('STDIN')) { ?> diff --git a/update_daemon2.php b/update_daemon2.php index 81734bc3..9b8a7ad6 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -29,6 +29,13 @@ die("error: This script requires PHP compiled with PCNTL module.\n"); } + if (!is_array($options)) { + die("error: getopt() failed. ". + "Most probably you are using PHP CGI to run this script ". + "instead of required PHP CLI. Check tt-rss wiki page on updating feeds for ". + "additional information.\n"); + } + $master_handlers_installed = false; $children = array();