Python Forum

Full Version: How to run php in a python file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have a problem i am currently creating a website with php and i have a pyhton program that i want to run on my website i tried using the php function include but that just printed all of the code instead of the output of the code.
Please post your code
Have you tried using the php execute?
https://www.php.net/manual/en/function.exec.php
Why? Is there a reason you're not just writing the web app in Python?
What kind of webserver are you using? You will have to configure CGI (Common Gateway Interface) to make your webserver understand it has to execute code and return the result to the browser. Perhaps there are other ways then CGI, I am not sure of that.
(Mar-05-2020, 10:53 PM)menator01 Wrote: [ -> ]Have you tried using the php execute?
https://www.php.net/manual/en/function.exec.php

no i havent yet i could try that though