shell_execを使用してphpファイルを実行しようとしましたが、これはコードでした:
$ex="php -f ".rtrim(dirname(__FILE__))."/sendmail.php";
if(substr(php_uname(), 0, 7) == "Windows")
pclose(popen("start /B ".$ex,"r"));
else
shell_exec($ex." > /dev/null 2>/dev/null &");
問題は、私のサーバーでは機能しなかったことです ( -f
.
$ex="php-cli ".rtrim(dirname(__FILE__))."/sendmail.php";
if(substr(php_uname(), 0, 7) == "Windows")
pclose(popen("start /B ".$ex,"r"));
else
shell_exec($ex." > /dev/null 2> /dev/null &");
なぜそれが機能するのか誰か教えてもらえますか?php-cli は存在しますか?
前もって感謝します