Page 1 of 1

'system()' function of PHP in kubuntu workstation?

Posted: Wed Oct 17, 2007 8:09 pm
by luzlin
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.

Posted: Thu Oct 18, 2007 9:50 pm
by jeffery
what command is "/bin/root " ?