I am trying to access a function made in PHP
in filenamed as php1.php in python3
. I saw a post
but Since I don't have enough reputation to comment on that. I am posting my query here.
This is the code I tried here:
import subprocess
subprocess.call(["php", "./php1.php"])
script_response = subprocess.check_output(["php", "./php1.php"])
and getting this error.
Traceback (most recent call last):
File "test3.py", line 7, in <module>
subprocess.call(["php", "./php1.php"])
File "/usr/lib/python3.5/subprocess.py", line 557, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'php'
I think I am missing something basic. Please help me.