Skip to content

Conversation

@pierredup
Copy link

Fixes https://bugs.php.net/bug.php?id=78323

When running php with invalid option, e.g. "php --memory-limit=1G" instead "php -dmemory-limit=1G" the PHP help is displayed and return code 1 instead of 0

Copy link
Contributor

@carusogabriel carusogabriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a unit test for this one?

@pierredup
Copy link
Author

@carusogabriel Done

@nikic
Copy link
Member

nikic commented Aug 9, 2019

Looks like some of the new tests are failing:

========DIFF========

001+ Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F [-O]]

002+   -c <path>|<file> Look for php.ini file in this directory

003+   -n               No php.ini file will be used

004+   -d foo[=bar]     Define INI entry foo with value 'bar'

005+   -e               Generate extended information for debugger/profiler

006+   -h               This help

007+   -i               PHP information

008+   -m               Show compiled in modules

009+   -v               Version number

010+   -p, --prefix <dir>

001- Error in argument 1, char 1: no argument for option -

003- 

004- Done: 1

012+   -g, --pid <file>

013+                    Specify the PID file location.

014+   -y, --fpm-config <file>

015+                    Specify alternative path to FastCGI process manager config file.

016+   -t, --test       Test FPM configuration and exit

017+   -D, --daemonize  force to run in background, and ignore daemonize option from config file

018+   -F, --nodaemonize

019+                    force to stay in foreground, and ignore daemonize option from config file

020+   -O, --force-stderr

021+                    force output to stderr in nodaemonize even if stderr is not a TTY

022+   -R, --allow-to-run-as-root

023+                    Allow pool to run as root (disabled by default)

024+ 

025+ Done: 64

========DONE========

FAIL FPM: Bug #78323 Test exit code for invalid parameters [sapi/fpm/tests/bug78323-invalid-parameters-exit-code.phpt] 

and

========DIFF========

001+ Error in argument 1, char 1: no argument for option -

003- 

004- Done 1

004+   -a               Run interactively

005+   -b <address:port>|<port> Bind Path for external FASTCGI Server mode

006+   -C               Do not chdir to the script's directory

007+   -c <path>|<file> Look for php.ini file in this directory

008+   -n               No php.ini file will be used

009+   -d foo[=bar]     Define INI entry foo with value 'bar'

010+   -e               Generate extended information for debugger/profiler

011+   -f <file>        Parse <file>.  Implies `-q'

012+   -h               This help

013+   -i               PHP information

014+   -l               Syntax check only (lint)

015+   -m               Show compiled in modules

016+   -q               Quiet-mode.  Suppress HTTP Header output.

017+   -s               Display colour syntax highlighted source.

018+   -v               Version number

019+   -w               Display source with stripped comments and whitespace.

020+   -z <file>        Load Zend extension <file>.

021+   -T <count>       Measure execution time of script repeated <count> times.

022+ 

023+ Done: 1

========DONE========

FAIL Bug #78323 Test exit code for invalid parameters [sapi/cgi/tests/bug78323.phpt] 

@krakjoe
Copy link
Member

krakjoe commented Sep 30, 2019

@pierredup what is the status of this PR ?

@pierredup
Copy link
Author

@krakjoe Just trying to get the tests to pass, will have it fixed in the next couple of days

@pierredup
Copy link
Author

Fixed in #5093

@pierredup pierredup closed this Jun 20, 2021
@pierredup pierredup deleted the bug-78323 branch June 20, 2021 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants