1。函数:
passthru()
: Executes a system command and sends its raw output directly to the browser.
2.用例:
exec()
passhru()- :当您需要执行产生非文本输出的二进制程序或命令时,很有用,例如图像或PDF文件。示例:使用命令行实用程序生成PDF报告。,建议由于安全风险和可移植性问题而避免使用这些功能。 External command execution can be susceptible to command injection attacks, where malicious input can execute arbitrary commands on your server.
If using these functions is unavoidable, take the following precautions:- Sanitize and validate user inputs to prevent command injection.
- Use the escapeshellarg() function to prevent shell元处理器被解释为命令的一部分。考虑使用替代方法来运行外部程序,例如php Process Contror Control函数或外部库。