通过 PHP 向屏幕发送命令?
我想知道如何通过 PHP 在虚拟专用服务器上运行的屏幕上执行命令。
即
if(submit){
do "say This is a minecraft server." in screen.
}
提前致谢,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我想知道如何通过 PHP 在虚拟专用服务器上运行的屏幕上执行命令。
即
if(submit){
do "say This is a minecraft server." in screen.
}
提前致谢,
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
如果您在屏幕下运行脚本,则只需
echo
或print
您想要显示的数据。否则,您可以:
tail -f
的文件通过屏幕轮询新消息)If you are running the script under screen, then just
echo
orprint
the data you want to display.Otherwise you can:
tail -f
ing in the screen (or some other system by which the screen polls something for new messages)仍然不清楚你的意思,但如果这就是你正在寻找的,你可以使用反引号运算符执行linux命令,例如
打印脚本所在目录的内容。因此,如果您想将命令打印到服务器,您可以这样做。
Still unclear on exactly what you mean, but if this is what you're looking for, you can execute linux commands by using the backtick operator, such as
to print the contents of the directory where the script is located. So if you wanted to print commands to your server, you could do it that way.