lindsten Posted September 30, 2007 Share Posted September 30, 2007 Hi everyone! I've got a very simple script with shell_exec that's giving me a headache! My server is a NetBSD machine running LightTPD (1.4.8nb1) and php (5.1.1nb2). I've got the file dummy.php with the following content: <?php error_reporting(E_ALL); $res = shell_exec("pwd 2>&1"); echo $res; ?> When I access this file through a browser i can't see any output: http://my.url/dummy.php results in a blank page that loads in no time! No error messages, neither output by the browser or in the log files (php.log and LightTPD's error.log). ??? When I use the terminal on the servern it all works fine: php /path/to/wwwroot/dummy.php gives me the working directory. Doesn't matter from which working directory I execute the command, or which user (I've tried the LightTPD user aswell). It works every time! safe_mode is off and there are no disabled_functions! I've asked around in LightTPD forums, but they say it's a PHP problem. So, I've asked around in (other) PHP forums but noone seems to have any ideas how to solve this! :'( Perhaps there are expert users here that can help me, or at least redirect me to some other expert forum. Thanks for any help! / Mikael Link to comment https://forums.phpfreaks.com/topic/71233-solved-problem-with-shell_exec-on-lighttpd/ Share on other sites More sharing options...
lindsten Posted September 30, 2007 Author Share Posted September 30, 2007 *bump* Link to comment https://forums.phpfreaks.com/topic/71233-solved-problem-with-shell_exec-on-lighttpd/#findComment-358559 Share on other sites More sharing options...
lindsten Posted October 7, 2007 Author Share Posted October 7, 2007 Problem solved! My mistake! I forgot to add a shell to my chroot. Hard to use a shell if there is none! Link to comment https://forums.phpfreaks.com/topic/71233-solved-problem-with-shell_exec-on-lighttpd/#findComment-364062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.