Jump to content

How can I execute a python script from a php page ?


PlymWS

Recommended Posts

Hi all,

I use a python-based program on my webserver to download NZB files.  The program is called hellanzb and resides in /var/www/nzb.

To shut the program down if it crashes I have to SSH into the box and execute the following command :

[code]python hellanzb.py shutdown[/code]

This shuts the program down.  Would it be possible to do this from a button on a web page.  I have tried using the exec() and shell_exec() commands to try and run the command from a php page (pressing a button) but the command doesn't work as the server stays running.

What would the code or command be to get this to run ?  Indeed, is it possible to execute a python script from php ?

Any help would be appreciated.
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.