I work on windows 7. I try to execute the Gnuwin32 grep
command from within a PHP script like so var_dump(shell_exec("grep"))
, so I can see if it works or not. Instead of the expected output of usage:
and things like that I get null
.
-
C:\gunwin\bin
is on my Windows path and on the PHPinclude_path
-
grep
works from the command line -
shell_exec('dir')
(or any other 'regular' windows-environment command) works as expected
I'm sure I'm missing something obvious here, but I can not find out what it is. Does anyone have a suggestion?
EDIT: something strange happened. I tried shell_exec('wget')
, just for the sake of it. This works as expected. After that, I tried shell_exec('grep --help')
and this actually returns the output I expected. I'm a little confused now.