Jump to content


Photo

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


  • Please log in to reply
No replies to this topic

#1 PlymWS

PlymWS
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 September 2006 - 05:42 PM

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 :

python hellanzb.py shutdown

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users