The Apache Haus Forum

Advanced search  


Welcome to Apache Haus Distribution Forum

Sorry Guest, you are banned from posting and sending personal messages on this forum.
Error: S4296
This ban is not set to expire.
Pages: [1]   Go Down

Author Topic: [PHP] Get apache pid and path  (Read 11227 times)


  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
[PHP] Get apache pid and path
« on: May 04, 2009, 02:51:58 PM »

Sometimes it is nice to see which apache runs. On my dev machine I run several apache in different versions for testing.
I made a small command line php script for seeing which apache runs. I named it pid.php

Code: [Select]
= new COM('winmgmts://');
$processes $wmi->ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'httpd.exe'");
$processes as $process){
'cmd line: '$process->CommandLine ' --> pid: '$process->ProcessId "\r\n";

on the command line php.exe pid.php
Code: [Select]
I:\server2\php>php pid.php
cmd line: "I:\server2\apache\bin\httpd.exe" -w --> pid: 3184
cmd line: I:\server2\apache\bin\httpd.exe -d I:/server2/apache --> pid: 2236

Pages: [1]   Go Up

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13