[英]Execute a command on a remote server using php
我需要在我的php項目中執行此命令,首先需要訪問文件access.log並顯示它,然后過濾下一個代碼:
cat access.log |grep "2013-10-09" |grep Receive |grep from |grep 8386|wc -l
我知道我需要建立與SSH服務的連接,但我不知道如何執行命令以訪問access.log並打開它。 我真的需要你的幫助!
謝謝!
歡迎您熟悉ssh2_connect()
, ssh2_exec()
和所有ssh2_
函數家族。
在這里嘗試: http : //php.net/manual/en/function.ssh2-connect.php http://www.php.net/manual/en/function.ssh2-exec.php
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.