Home > Backend Development > PHP Tutorial > About the pitfalls encountered by PHP Shell_exec

About the pitfalls encountered by PHP Shell_exec

藏色散人
Release: 2023-04-08 07:16:02
forward
2920 people have browsed it

Because you need to use shell_exec to execute python scripts in the project, under test shell_exec("test.py") can run normally without errors, but adding a directory shell_exec("python/test.py") will not work. Use For the PHP framework, I initially thought that the reason was PHP's directory limitation, but after trying to no avail, I found that it was not a directory problem.

So I thought maybe the shell_exec command does not support directories? A word awakened the dreamer, shell_exec is equivalent to command line execution

The code can be changed from the original

About the pitfalls encountered by PHP Shell_exec

to the following picture, which is a perfect solution.

About the pitfalls encountered by PHP Shell_exec

For more PHP related knowledge, please visit PHP Tutorial!

The above is the detailed content of About the pitfalls encountered by PHP Shell_exec. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template