Is there any alternative for PHP exec(), shell_exec(), system(), passthrough() functions?

泄露秘密 提交于 2019-12-12 04:16:09

问题


Is there any alternative for PHP exec(), shell_exec(), system(), passthrough() functions? As all these functions have security risk, need a way to execute server commands without using any of these functions.

Due to security reasons, can't enable these functions on my server php configuration. But as per website requirement, I need to execute some external commands like server ssh commands through php script. So, if there are any alternative ways to achieve same then please reply back to me.


回答1:


You can write shell or bash scripts and invoke them through cron or set a daemon and let it check for a specific flag in database if you can do that.



来源:https://stackoverflow.com/questions/35224251/is-there-any-alternative-for-php-exec-shell-exec-system-passthrough-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!