Php fails to call python and outputs are executed on the terminal, but not on the browser.

Source: Internet
Author: User
This is a python script #! Usrbinpythonm 3.12345612345 print (m); the browser can output the result when the PHP script is called like this, but when the Python script is :#! Usrbinpythonimport epicsm epics. caget (& #39; VME: Voltage_N12V & #39;) print (m). then, no output is returned when you call the browser using PHP... However, the output result phppython is executed on the terminal.

This is a python script.
#! /Usr/bin/python
M = 3.12345612345
Print (m );
This is a PHP script.
$ Output = shell_exec ('Python helloworld. py ');
Echo"

$ Output
";
?>
In this way, the browser can output the results.

However, when the Python script is:
#! /Usr/bin/python
Import epics
M = epics. caget ('vme: Voltage_N12V ')
Print (m)
In this case, no result is output when you use PHP to call the browser... However, the execution on the terminal has output results.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.