D
D
druzhanja2016-07-02 19:21:21
PHP
druzhanja, 2016-07-02 19:21:21

How to run python script from php on xampp which is installed on windows?

there are two files e:\xampp\htdocs\script\test.php and e:\xampp\cgi-bin\test.py
the python program is here c:\Python27\python.exe
test.py

#!/Python27/python
    print "Content-type: text/plain\n\n"
    print "Hello world"

test.php
$python =  exec('python e:\xampp\cgi-bin\test.py');
  echo "Python is printing: " .  $python;

This code does not run ((
How to run it correctly so that the text is displayed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question