Jump to content

Apache, Php, Python and Expect


half.italian

Recommended Posts

I've tried a couple of Python forums with this question, but the more I think about it, the more I think has something to do with the apache environment.

I'm basically trying to have a php page pass one string variable and execute a command on the server using that variable.  I found php system() and exec() and am using system().  The command is executed.  So far so good.  Inside the script (which is python) I use expect to become root, and execute several commands.  Here's the glitch.  If I run the python script from the command line, as 'www' (the user my apache runs as) it becomes root as it should and executes the commands sucessfully.  But, If I have a php script execute the exact same python script, expect does not accept the password, and the commands fail.

I've come to realize that there is something in the apache environment that is not allowing 'www' to become root.  Any ideas on what is going on, or even ideas on how to debug??  I'm at a loss.  Thanks in advance.

~Sean D
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.