Trying to run a jar from PHP

前端 未结 3 1841
梦毁少年i
梦毁少年i 2021-01-28 08:16

After reading some of the posts in this website related to exactly the same issue I\'ve got, I found that none of them were giving me a successful result:

How to run a j

3条回答
  •  再見小時候
    2021-01-28 08:28

    You can check with shell_exec, system() and other function pctl function as well. These functions might be disabled, so before executing check them or you can use this as well

    function execInBackground($cmd) { 
        if (substr(php_uname(), 0, 7) == "Windows"){ 
            pclose(popen("start /B ". $cmd, "r"));  
        } 
        else { 
            exec($cmd . " > /dev/null &");   
        } 
    } 
    

    More detail found here.

提交回复
热议问题