Using PHP to call python script -
this question has answer here:
- getting php run python script 4 answers
i have following php code want use call python script (ring.py)
<?php echo '<p>hello world</p>'; $output = exec('python ring.py'); ?>
the program ring.py creates 2 files. when run php script command line:
php index.php
then php script correctly runs python script , 2 files created desired.
however when accesses php page through web browser, doesn't seem run python script , no files created. how can fix this?
thanks much!
make sure python script on server executable
chmod +x ring.py
and make sure it's either in same directory php script or use full path.
Comments
Post a Comment