I am running the nginx web server along with PHP-CGI.
I would like to know if it is possible to execute a Python script inside PHP pages, which allows you to combine both languages. I tried this briefly, but it didn't work, so I'm not sure how to do this. Here are the two files I used:
index.php
<body> <p>Hello! Here is a message: <?php exec('python hello.py'); ?></p> </body>
hello.py
print 'Hello World!'
Any clues would be appreciated.
source share