This question already has an answer here:
- Getting PHP to run a Python script 4 answers
I have the following PHP code that I want to use to call a python script (ring.py)
<?php echo '<p>Hello World</p>';
$output = exec('python ring.py');
?>
The program ring.py creates 2 files. When I run the PHP script from command line:
php index.php
then the php script correctly runs the python script and 2 files are created as desired.
However when someone accesses the PHP page through a web browser, it doesn't seem to run the python script and no files are created. How can I fix this?
Thanks so much!
</div>