Using PHP to call python script -


this question has answer here:

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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -