我有一個情況從PHP程序啓動Apache Tomcat服務器。 我試過,如下圖所示:啓動Tomcat服務器編程方式使用PHP
$las = system('cmd C:\apache-tomcat-8.0.21\bin\startup.bat',$ret);
echo $las. $ret;
//output
Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\xampp\htdocs\web\operations>C:\xampp\htdocs\web\operations>0
但它不工作。
然後我試圖這樣。
echo exec('C:\apache-tomcat-8.0.21\bin\startup.bat');
輸出:打開cmd並立即關閉它,並出現以下錯誤。
我怎樣才能使它發揮作用。
感謝很多的任何文件。我添加了我得到的錯誤的快照。當我運行'exec('C:\ apache-tomcat-8.0.21 \ bin \ startup.bat');'它打開帶有該錯誤的cmd(在快照中)並在第二秒關閉。 – Sirisha
您是否看到我編輯的答案? –