[英]shell_exec not executing command in php
我正在嘗試從Windows計算機運行此命令,但無法使其正常工作。 當我將其輸入命令提示符時,該命令可以正常運行,但是當我執行PHP腳本時,該命令卻無法正常運行。
$command = '"C:\Program Files (x86)\WinSCP\winscp.exe" /console /command "open client" "cd /var/www/html/reports" "put C:\wamp\www\client\test.php" "exit"';
shell_exec($command);
嘗試使用exec()
可以幫助您進行調試。
<?php
$command = '"C:\Program Files (x86)\WinSCP\winscp.exe" /console /command "open client" "cd /var/www/html/reports" "put C:\wamp\www\client\test.php" "exit"';
$cmd = exec($command, $arr, $opt);
// Output info run from the command:
var_dump($cmd, $arr, $opt);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.