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-23T19: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-23T19: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-23T19: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-23T19: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-23T19: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

2
  • Please add more details from your logs (system.log and exception.log), there is missing some information.
    – SR_Magento
    Dec 24, 2016 at 12:01
  • these are all the errors in my system.log
    – rizwan
    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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.