0

I have a PHP script like this:

<?php  
  system("firefox http://run.imacros.net/?m=the_macro.iim 2>&1");
  // CODE//  
?>  

When I run this from terminal, opens my FireFox normally but never run the rest of the code in the script!
If I close the FireFox manually then the script runs the rest of the code.

I want to execute my script without stacking in the system() command.

Trinimon
  • 13,839
  • 9
  • 44
  • 60
Manos Serifios
  • 577
  • 2
  • 7
  • 22

1 Answers1

0

The 2>&1 redirects stderr to stdout, but you haven't redirected stdout, so if any output is generated to either handle, PHP waits. To discard any output to both handles, use

system("firefox http://run.imacros.net/?m=the_macro.iim >/dev/null 2>&1");
grahamj42
  • 2,752
  • 3
  • 25
  • 34