DP Full Stack Passionate Developer



Posts Tagged / Python

How to call Python file from within PHP?

December 29, 2020 | PHP | by admin

In Linux you need to do two things1) make python file executable sudo chmod +x testd.py 2) make sure you defined the environment where python is getting executed #!usr/bin/<path of python env> 3) use escapeshellcommand() to include python file and shell_exec() to execute it. You can pass command line arguments also as params In PHP use […]