1

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

Ronak Chauhan
6,2133 gold badges31 silver badges67 bronze badges
asked Dec 24, 2016 at 11:57
2
  • Please add more details from your logs (system.log and exception.log), there is missing some information. Commented Dec 24, 2016 at 12:01
  • these are all the errors in my system.log Commented Dec 24, 2016 at 12:14

1 Answer 1

0

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

answered Dec 24, 2016 at 12:21
2
  • are you able to kindly elaborate. Commented Dec 24, 2016 at 12:25
  • when you print $_SERVER['argv'] do get data or an empty array ? Commented Dec 24, 2016 at 12:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.