Run (remote) php script from (local) python script

php, python

Solution

If python is on a different physical machine than the PHP script, I'd make sure the PHP script is web-accessible and use urllib2 to call to that url

import urllib2

urllib2.urlopen("http://remotehost.com/myscript.php")

Problem

How do I make python (local) run php script on a remote server? I don't want to process its output with python script or anything, just execute it and meanwhile quit python (while php script will be already working and doing its job). edit: What I'm trying to achieve: - python script connects to ftp server and uploads php script (I already have this part of code) - it runs php script (that's part of code i'm asking about) - python script continues to do something else - python script quits (but probably php script still didn't finished its work so i don't want it to end when it'll exit python) - python script quit, php script still continues its task (I don't plan to do anything with php output in python - python just has to upload php script and make it start working) Hope I'm more clear now. Sorry if my question wasn't specific enough. another edit: Also please note that I don't have shell access on remote server. I have only ftp and control panel (cpanel); trying to use ftp for it.

Original source

Related problems