Execute script with COM in the background using php

Viewed 42

Hello I want to run script using COM in the background.

Here is my code:

$WshShell = new COM("WScript.Shell");
$obj = $WshShell->Run("cscript C:/Users/Administrator/Desktop/PhotoshopImg/script.vbs", 0, true);

I want to run the script in the background. Its possible?

Thanks you :)

1 Answers

Given how PHP scripts are often run using Apache/Ngnix server, and are used to server content, my answer is: no. It's not possible.

However, you might use queuing solutions like redis or rabbitMq to schedule/run some jobs, which might be thought of "in the background", even though they are just separate PHP processes.

Related