Jump to content

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


luzlin

Recommended Posts

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!

'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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.