使用 COM("WScript.Shell") 在后台调用 Codeigniter 控制器功能不起作用

Call Codeigniter controller function in background using COM("WScript.Shell") is not working

我想在后台发送推送通知。为此,我想调用 php 文件,该文件将使用 COM 在后台发送推送通知。这是我的代码,我想在其中使用 COM 调用控制器函数。但是没用。

  $WshShell = new COM("WScript.Shell");
  $oExec = $WshShell->Run("D:\wamp\bin\php\php5.4.16\php-win.exe -f D:\wamp\www\Project_name\Controller\function", 0, false);

请帮帮我

正如用户指南所说 运行 通过 cli 你必须通过 index.php 传递所有内容并提供控制器和方法。工具是控制器,消息是function/method,参数是引号

$ php index.php tools message "hello world"

我猜你会是这样的,但你得试试。

$oExec = $WshShell->Run("D:\wamp\bin\php\php5.4.16\php-win.exe -f D:\wamp\www\Project_name\index.php Controller Function", 0, false);