I've written a script that queries various files for data. Using shell_exec(), I've been able to get perl, mysql, php, and other data. However, when I try to do a shell_exec("python -V"), I get nothing back.

I've SSH'ed into the box, Python is installed, and does respond to 'python -V'.

Any ideas as to why shell_exec() is returning an empty result?

TIA

    Did you su to 'nobody' (the user apache runs under) when SHH'd into the box?
    Even if the permissions are OK for python to be run by 'nobody' the path may not be in $PATH . I suggest using the full path for the python command (/usr/bin/python in my box)
    HTH
    Bubble

      It's in the path...calling it with a absolute path still gives me nothing.

      You may be on to something with the nobody login...I'm not sure if that would cause it but then again I'm new to Linux.

      I'll check with my Linux guy to see.

      If you have any other ideas, drop um here.

      Thanks

        Figured it out...

        The problem is that python –V writes to errout (2) so this php code works:

        [pre]shell_exec("python -V 2>&1");[/pre]

        In case anyone trips on this one later.

          Write a Reply...