thank you for the prompt reply. I just tried to follow your suggestion, but
i couldn't solve my problem:
1. I have started the server with user "nobody". All the binaries i was
trying to execute(e.g. /bin/ls) were "chown"-ed to the user "nobody"
Problem presisted. Than i "chown" -ed /var/www to the user "nobody". Than
the php and php-cgi interpreters as well- same thing.
I tried the same with users "adm" and even "root"
2. I than gave the executables all the permissions possible("777"- i know it
is dangerous, but i am just testing)- still nothing.
I copied the binaries from /bin to /var/www and tried to execute them
with all kinds of permissions and "chown"'s- didn't work
3. Than i moved to the command line interpreter: i tried to execute it in
/var/www and in the home folder. The permissions were also adjusted. I
executed it with root privileges- i always get "Segmentation fault". One
more thing- if i omit the arguments in shell_exec( "$output = shell_exec();)
i get "Missing parameters" but no "Segmentation fault"
On Sun, Oct 31, 2010 at 4:34 PM, <ad...@buskirkgraphics.com> wrote:
> It seems most probably a permission problem. If I were you I would
> check the permissions on the bin directory and the files in it. PHP
> will probably run under the uid of the webserver, which, on most
> systems is either "apache" or "nobody" depending on the configuration.
> Richard L. Buskirk
> -----Original Message-----
> From: Boyan Penev [mailto:boyan...@googlemail.com]
> Sent: Sunday, October 31, 2010 11:16 AM
> To: email@example.com
> Subject: [PHP] Problem with "shell_exec"
> i have installed php 5.2.14 on an embedded system. I have run a couple of
> test scripts and everything works fine,
> but i can't get "shell_exec" to work. When i invoke "shell_exec", the
> script doesn't get interpreted, instead
> i get prompted to download the whole .php file. I have tried both /bin/php
> and /bin/php-cgi- same problem.
> When i try to execute it per command line instead of web server, with both
> php and php-cgi i get "Segmentation fault"
> and nothing happens. I use busybox http as a web server, if it's relevant.
> Does anybody have an idea what the problem
> might be? Any help would be appreciated.
> Best regards,