1

I'm running a php script which is not working properly in my windows OS but this is supposed to work in linux.

I figured it out that nohup is not an associated tool with windows.

$ffmpeg = 'C:\ffmpeg\bin\ffmpeg';
$command = "nohup >/dev/null 2>&1 ".$ffmpeg." -i {$input_path} {$ffmpeg_string} -stats -y {$output_path} 2> {$log_path} >/dev/null &";
exec( $command ); 

So what could be my best alternatives if I want to run this code on windows. Detailed explanation will be greatly appreciated as I don't know much about background process.

nohup on windows, exec without waiting for finish

Community
  • 1
  • 1
  • Have you tried the `$shell = new COM("WScript.Shell");`, that's what I would do if I was unable to scrap windows and move to linux, then again id recommend using beanstalkd to run the background task.. – Lawrence Cherone Dec 24 '14 at 17:29

1 Answers1

0

nohup >/dev/null 2>&1

The above command redirects everything from console to the null location, including the error log (2>&1).

on Windows this is done using echo off in batch.

Your question should probably be changed to "What is the equallent of nohup on Windows", it gives clarity.

i think this link gives you more information on your issue: What's the nohup on Windows?

Community
  • 1
  • 1
  • Actually I am not well known to this kind of term 'echo off in batch'. In php how can it be accomplished? – Abdullah Al Mamun Dec 24 '14 at 17:26
  • when you run a script on console, if there is too much content that the script prints on the console, we use "@ echo off" before the command so that we tell the OS that we are interested only in the result and not the logs – Ganesh Kamath - 'Code Frenzy' Dec 24 '14 at 17:35
  • your problem is more towards PHP. Where you are running "nohup" concatenating string to form your command such that it is not interrupted. Have you treid removing this part of the code '"nohup >/dev/null 2>&1 "' and replacing it with "javaw.exe " on a machine where java is installed and environmental variables are properly set for Java. – Ganesh Kamath - 'Code Frenzy' Dec 24 '14 at 17:40
  • Removing the code I got the result like my conversion is being done but didn't get any current progress of the conversion. javaw.exe is not installed on my machine. – Abdullah Al Mamun Dec 24 '14 at 17:44