PHP CLI has suddently stopped working on the server. When running any php file even php -v to get php version I get following error.
Thanks
# php -v
Unknown option: v
php [-f from_encoding] [-t to_encoding] [-s string] [files...]
php -l
php -r encoding_alias
-l,--list
lists all available encodings
-r,--resolve encoding_alias
resolve encoding to its (Encode) canonical name
-f,--from from_encoding
when omitted, the current locale will be used
-t,--to to_encoding
when omitted, the current locale will be used
-s,--string string
"string" will be the input instead of STDIN or files
The following are mainly of interest to Encode hackers:
-D,--debug show debug information
-C N | -c | -p check the validity of the input
-S,--scheme scheme use the scheme for conversion
Type
which phpon your shell to find whichphpexecutable your shell picks from your searchPATH.Use
ls -l $(which php)to see if it’s a symlink to some other executable.What you see when running
php -vis actually output of thepiconvcommand.Most possibly, there is a symlink named
phppointing topiconvsomewhere in your searchPATH.Type
echo $PATHto see the order of directories in which your shell searches for an executablephp.EDIT:
Changed
whereistowhichin the command above.