I have checked my System.log to find im getting the above error, the below is the code from line 144, would any body be able to advise on how to resolve.
 foreach ($_SERVER['argv'] as $arg) {
 $match = array();
 if (preg_match('#^--([\w\d_-]{1,})$#', $arg, $match) || preg_match('#^-([\w\d_]{1,})$#', $arg, $match)) {
 $current = $match[1];
 $this->_args[$current] = true;
 } else {
 if ($current) {
 $this->_args[$current] = $arg;
 } else if (preg_match('#^([\w\d_]{1,})$#', $arg, $match)) {
 $this->_args[$match[1]] = true;
other errors include
2016年12月23日T19:30:02+00:00 ERR (3): Warning: Invalid argument supplied for foreach() in /home/onyxclot/public_html/shell/abstract.php on line 144
2016年12月23日T19:35:03+00:00 ERR (3): Warning: strpos(): Empty needle in /home/onyxclot/public_html/lib/Zend/Controller/Request/Http.php on line 508
2016年12月23日T19:35:03+00:00 ERR (3): Warning: strpos(): Empty needle in /home/onyxclot/public_html/lib/Zend/Controller/Request/Http.php on line 514
2016年12月23日T19:35:03+00:00 ERR (3): Warning: session_start(): Cannot send session cookie - headers already sent in /home/onyxclot/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 133
2016年12月23日T19:35:03+00:00 ERR (3): Warning: session_start(): Cannot send session cache limiter - headers already sent in /home/onyxclot/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 133
- 
 Please add more details from your logs (system.log and exception.log), there is missing some information.SR_Magento– SR_Magento2016年12月24日 12:01:46 +00:00Commented Dec 24, 2016 at 12:01
 - 
 these are all the errors in my system.logrizwan– rizwan2016年12月24日 12:14:32 +00:00Commented Dec 24, 2016 at 12:14
 
1 Answer 1
Invalid argument supplied for foreach() Error arises due to empty or a non array so I suggest you check
$_SERVER['argv']
You add some condition to prevent this