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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
luzlin
Forum Newbie
Posts: 1
Joined: Wed Oct 17, 2007 7:58 pm

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

Post 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.
jeffery
Forum Contributor
Posts: 105
Joined: Mon Apr 03, 2006 3:13 am
Location: Melbourne, Australia
Contact:

Post by jeffery »

what command is "/bin/root " ?
Post Reply