Python script running by php

Dutch

Verified User
Joined
Apr 11, 2017
Messages
15
Hi,

What is the best way to run a Python script by a PHP script?

Who can help me with the right and most secure answer?
 
if you on cli. cronjob, you can do something like this.
Code:
php -d disable_functions="" test.php
and then you can use "proc_open" to start python program.

if running on front end, I suggest using "phpseclib" combined with "ssh publickey auth" to initial ssh session and you can execute "python test.py"
 
if you on cli. cronjob, you can do something like this.
Code:
php -d disable_functions="" test.php
and then you can use "proc_open" to start python program.

if running on front end, I suggest using "phpseclib" combined with "ssh publickey auth" to initial ssh session and you can execute "python test.py"
Thanks but I don't want to disable_functions="" because it's not secure enough.
 
then "phpseclib" is your choice, I also usee this library too, for use to ping check online and other thing that need reauired CLI command. it support SSH pure password and publickey auth.
 
Back
Top