Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44089 invoked from network); 31 Mar 2011 09:24:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2011 09:24:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:51084] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/A3-16878-E48449D4 for ; Thu, 31 Mar 2011 04:24:31 -0500 Received: by qwi4 with SMTP id 4so1496490qwi.29 for ; Thu, 31 Mar 2011 02:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:from:date:message-id :subject:to:content-type; bh=nTZZ8TK3OHcwIhDTqkINQYaGjvtjxgTXGGMeqa1Cuvo=; b=vRhfqr+/vz8WssPIcsXLDdTm4HQx7VKuybq4o2E12xUJosd/cU188vZo+SU6AerKHT UPPeYvZSiHHT0uvO8ohX5bJtUf2lgvTseXNXGOkzQelrVhk+njngYAgnJQRdLJ5M4xRY /sLk31MHh+qNV+bj2IUEr8tKIOXZZCE61mjUI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:from:date:message-id:subject:to:content-type; b=Tiwnkmr5WmODQNwHoQFgfxDqxSuHytW0hbdEI/hvsJ4d84XlXCFhT7tuFIQ32Ty5sc x9Z6t8pKpzeZXIwfLFG1nEcQCBgI5Hqi1GZxwZ8Zp/t9WGfX+Se9kyYO8nnT4bGsYrbN +hC/N9L4gDWGwSNr2vK3hW+RiNCyZQ0ckk9gs= Received: by 10.229.124.145 with SMTP id u17mr2029618qcr.71.1301563468107; Thu, 31 Mar 2011 02:24:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.40.147 with HTTP; Thu, 31 Mar 2011 02:24:08 -0700 (PDT) Reply-To: RQuadling@googlemail.com Date: Thu, 31 Mar 2011 10:24:08 +0100 Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Determine the name of the PHP SAPI module. From: rquadling@gmail.com (Richard Quadling) Hi. From a CLI/CGI perspective, the following code returns the full path of the php.exe file. DWORD len; char buf[MAX_PATH]; len = GetModuleFileName(NULL, buf, sizeof(buf)); buf[len] = '\0'; If PHP is loaded as a module, how do you determine the filename of the module. I'm guessing the above code would return Apache or IIS (if using ISAPI), etc. Is there a global property available for this (or for the above code)? Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY