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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.