I'm not sure exactly what your trying to do, but I use php and python together a lot. I usually call the python script from php with the passthru function like this: <?php $outputFromPy = passthru('/path/to/myScript.py'); ?>