Tearful begging-php calls the system command. the shell can run successfully, but it won't work through the browser. how can this problem be solved?

Source: Internet
Author: User
Tearful begging-php calls the system command, shell can run successfully, but not through the browser & lt ;? Php $ cmd = & quot; python1.py-ta-fb & quot; system ($ cmd, $ ret );? & Gt; this code, if you directly use php in the shell to cry-php calls the system command, the shell can run successfully, but not through the browser
$ Cmd = "python 1.py-t a-f B ";
System ($ cmd, $ ret );
?>

This code, if you use php-f a directly in the shell. php and ret can return 0 successfully, but when accessed through a browser, 1.py fails to be executed, ret returns 1, you guys, what is going on? I am about to crash ~~~~~

------ Solution --------------------
There is no operation permission. attach sudo to your host and then:
$ Cmd = "sudo python 1.py-t a-f B"; // switch to the root operation permission
------ Solution --------------------
If the Permission problem occurs in linux, the web permission is another permission when running the command line.

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.