php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php-cgi-path-detection.patch for CGI/CLI related Bug #61949

Patch version 2012-05-05 06:56 UTC

Return to Bug #61949 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions: 2012-05-05 07:52 UTC | 2012-05-05 06:56 UTC

Developer: remi


 --- include.inc.old	2012-05-05 08:41:43.225085081 +0200
 +++ include.inc	2012-05-05 08:52:03.575099923 +0200
 --- include.inc.orig	2012-05-05 08:41:43.225085081 +0200
 +++ include.inc	2012-05-05 08:48:55.739095428 +0200
  @@ -3,7 +3,9 @@
   function get_cgi_path() /* {{{ */
   {
   	$php = getenv("TEST_PHP_EXECUTABLE");


  +	}
   	$cli = false;
   	$cgi = false;
   
 @@ -21,6 +23,10 @@
 @@ -20,6 +22,10 @@
  
   	if ($cli) {
   		/* trying to guess ... */
  		$php_path = $php;
  +		if (file_exists($php_path."-cgi") && is_executable($php_path."-cgi")) { 
  +			/* gotcha - run for install */
  +			return $php_path."-cgi";
  +		}
  		$php_path = $php;
   		for ($i = 0; $i < 2; $i++) {
   			$slash_pos = strrpos($php_path, "/");
  			if ($slash_pos) {
  @@ -31,7 +37,7 @@
   		}
   
   		if ($php_path && is_dir($php_path) && file_exists($php_path."/cgi/php-cgi") && is_executable($php_path."/cgi/php-cgi")) { 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC