Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: argv in ...../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 57 #5224

Closed
anonymous-matomo-user opened this issue May 25, 2014 · 7 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Milestone

Comments

@anonymous-matomo-user
Copy link

The following PHP Errors occur when I try to run the core:archive thru cron. They appear to be causing the core:archive process to fail

PHP Notice: Undefined index: argv in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 57
PHP Warning: array_shift() expects parameter 1 to be array, null given in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 61
PHP Warning: Invalid argument supplied for foreach() in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 287
PHP Warning: array_shift() expects parameter 1 to be array, null given in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 314
PHP Warning: Invalid argument supplied for foreach() in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 287
PHP Warning: array_shift() expects parameter 1 to be array, null given in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 314
PHP Warning: Invalid argument supplied for foreach() in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 287
PHP Warning: array_shift() expects parameter 1 to be array, null given in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 314
PHP Warning: Invalid argument supplied for foreach() in ..../vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 287

Ran System Check and no issues found

Piwik 2.3.0-rc4
Apache 2.2.27
PHP Version 5.4.28
MySQL version 5.5.37-log
Architecture x86_64
Operating system linux

@mattab
Copy link
Member

mattab commented May 25, 2014

Thanks for the report. Could you please copy the exact cron command you using?

@anonymous-matomo-user
Copy link
Author

/usr/php/54/usr/bin/php -c /home1/behuntne/software/scripts/php.ini -f /home1/behuntne/public_html/pi1226/console core:archive --url=http://behunt.net/pi1226/

Contents of PHP INI file:

[PHP]

;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limithh
memory_limit = 256M

; This directive determines whether PHP registers $argv & $argc each time it
; runs. $argv contains an array of all the arguments passed to PHP when a script
; is invoked. $argc contains an integer representing the number of arguments
; that were passed when the script was invoked. These arrays are extremely
; useful when running scripts from the command line. When this directive is
; enabled, registering these variables consumes CPU cycles and memory each time
; a script is executed. For performance reasons, this feature should be disabled
; on production servers.
; Note: This directive is hardcoded to On for the CLI SAPI
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/register-argc-argv
register_argc_argv = On

@tsteur
Copy link
Member

tsteur commented May 26, 2014

Hi eh215pi,

are you running PHP in cgi?

Ifphp-cli is available to you can you try to run this script withphp-cli instead ofphp? I think the console script only works with PHP CLI setting. Your hoster/server probably sets "PHP CGI" executable by default

@anonymous-matomo-user
Copy link
Author

Sorry for the delayed response I did find the path to PHP-CLI and used that but now have a different error.

See details in forum posting [http://forum.piwik.org/read.php?2,113835,116222#msg-116222]]

@tsteur
Copy link
Member

tsteur commented Jun 5, 2014

See #5007

Console doesn't work using CGI. It has to run using CLI.

@anonymous-matomo-user anonymous-matomo-user added this to the 2.4.0 - Piwik 2.4.0 milestone Jul 8, 2014
@mattab
Copy link
Member

mattab commented Nov 2, 2014

see follow up #6570

@erlangparasu
Copy link

php -d register_argc_argv=On

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

4 participants