Skip to content

executing .py in html/php

I wrote a Python script which writes its output into a txt file. Then I included that file in my html/php website. – works good so far. Only remaining problem: I can’t execute the .py file automatically while opening the site. I know that this isn’t the best solution <?PHP exec("python3"); ?> doesn’t seem to work



I used the commands chown -R www-data:www-data <directory> and chmod -R 755 <directory>. I’m not sure which command solved my problem, but at least its working.

User contributions licensed under: CC BY-SA
2 People found this is helpful