Hi,
I have a program that returns a comma-separated string of numbers after doing some background processing. I intended to run this in symfony using shell_exec
; however, all I get is NULL (revealed through a var_dump()
. I tried the following debugging steps.
I ran the file (it's a PHP class) through a command-line lime unit test in Symfony - it works and gives the correct result there.
Just to check, I tried a simple command ls -l
at the same place to see whether I would get anything. Again, I had the same problem - the var_dump
in the browser showed NULL, but it worked through the command line.
What could be the problem? Are there restrictions on running shell_exec()
in a browser?
EDIT: Just to clarify, shell_exec() commands work when I run them as standalone php scripts on the web server (for example, by putting them in my document root. They don't seem to be working under the symfony framework, for some reason.