I have searched extensively to solve the issue of opening an external program in phpdesktop without PHP waiting ultimately making PHP timeout.
I need to be able to launch the program with exec()
and have the rest of the PHP code execute without waiting on the exec()
command. I have tried multiple solutions. To make matters even more complicated the file that is being opened is on a networked drive. Here is what I have tried but has not worked
pclose(popen('start' .$File. '>NUL 2>NUL"', 'r')); This didn't work because the drive is on the network
exec($File); Doesn't work as it waits instead of executing the remainder of the code
system($File); Doesn't work. Same result as exec()
exec($File > /dev/null); Obviously doesnt work because php is on windows
The file being executed is a video file: mp4
, avi
or mkv
. So it's opening the external video player file but like I said above PHP ultimately times out and gives an error after 30 seconds without executing the rest of the code. I just need PHP to ignore the program it opened and go on about its tasks. Any help would be greatly appreciated.