luzlin Posted October 18, 2007 Share Posted October 18, 2007 I am a newbie to PHP and web development and I'm currently developing a web page using PHP to interact with linux shell commands. The 'shell()' function of PHP seems not to work properly in kubuntu workstation. i tried $return = system('ls'); echo return; it works well by listing all the folders/files in the webpage. However, system('/bin/root - l -b -q graph.C',$return); echo $return; it fails. The return value is 1 (no other error messages just '1'), meaning it failed to execute the command (that if I was right with the interpretation). It also failed in system('mv file to folder') The folder to folder is world writable (chmod 777 to folder). Now instead of using system(), I also tried using exec(),passthru(), and shell_exec() but still the same it did not work. If I'm right, the issue is about permissions. However, I dont know how to configure or how/what/where to set permissions for this thing to work. Any idea or clue would be highly appreciated. Btw I am using PHP5 and Apache2 on kubuntu. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/73729-system-function-of-php-in-kubuntu-workstation/ Share on other sites More sharing options...
trq Posted October 18, 2007 Share Posted October 18, 2007 Post some of the actual commands your trying to use, nothing you posted is a valid Linux command. Quote Link to comment https://forums.phpfreaks.com/topic/73729-system-function-of-php-in-kubuntu-workstation/#findComment-372120 Share on other sites More sharing options...
luzlin Posted October 18, 2007 Author Share Posted October 18, 2007 'root' is a valid Linux command. Although it is not a built-in command when you install kubuntu. It is from a software downloaded and compiled from "http://root.cern.ch". Anyway, i also tried the 'mv' linux shell command but it also did not work. Thanks for the reply. Quote Link to comment https://forums.phpfreaks.com/topic/73729-system-function-of-php-in-kubuntu-workstation/#findComment-372287 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.