Please enable java script to visit.
NOTEBOOK
HOMEPHP / MySQLJS / HTMLWXappPythonC++Blender其他
PHP 使用 exec() 执行服务器命令 - NOTEBOOK
PHP 使用 exec() 执行服务器命令
PHP / MySQL其他
Posted on 2022-12-23
摘要 : PHP 使用 exec() 执行服务器命令,存在安全性问题,不要轻易使用。
如果使用,不要接受外部参数!!不要接受外部参数!!不要接受外部参数!!
类似有危险的函数:system、exec、passthru、shell_exec
PHP 使用 exec() 执行服务器命令,存在安全性问题,不要轻易使用。
如果使用,最好不要接受外部参数,减少危险性。

exec($execCommand,$execOutput);
print_r($execOutput);


可以将多次命令的结果输入给 $execOutput
exec($execCommand,$execOutput);
exec($execCommand,$execOutput);

print_r($execOutput); // 两次执行结果都会显示