httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Streater <...@clothears.org.uk>
Subject [users@httpd] Launching apache from a PHP script - fine under OS X, what about Windows7 ?
Date Thu, 01 Jan 1970 00:00:00 GMT
I want to port my application, which runs fine under OS X, to Windows7. I have a PHP startup
script, which launches httpd as follows:

  // Now attempt to start apache

  $cmd = '/usr/sbin/httpd -f "/path/to/my/config/file" 2>&1';
  exec ($cmd, $results, $result);

  if  ($result!=0)
       {
       // Print contents of $results array and then exit
       }

  // Success in starting apache, carry on and do the next thing


Doing the above appears to satisfy these requirements:

1) start it in the background
2) redirect stderr to stdout so that any startup errors (e.g. bad config items) get picked
up and returned in $results in case of startup failure

What I'd like to know is whether the redirection is organised by the OS or by apache itself
- so do I do the same as above to pick up any stderr output from apache under Win7, or is
there a different mechanism?

Secondly, is (1) above satisfied because httpd, itself, relinquishes the console and puts
itself in the background at successful startup, or is it a side-effect of putting 2>&1
in the above?

--
Cheers  --  Tim


Mime
View raw message