Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37890815
en ru br
ALT Linux repos
5.0: 5.2.7.20080920-alt1.M50.1.1
4.1: 5.2.5-alt1.M41.3.6
4.0: 5.2.2-alt1

Group :: System/Servers
RPM: apache2-mod_php5

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: php-5.2.1-sapi-mod_php.patch
Download


diff -uNpar apache2handler/sapi_apache2.c apache2handler.alt-sapi/sapi_apache2.c
--- apache2handler/sapi_apache2.c	2007-01-01 12:36:12 +0300
+++ apache2handler.alt-sapi/sapi_apache2.c	2007-03-07 13:53:52 +0300
@@ -51,6 +51,7 @@
 #include "http_core.h"
 #include "ap_mpm.h"
 
+#include <errno.h>
 #include "php_apache.h"
 
 /* UnixWare and Netware define shutdown to _shutdown, which causes problems later
@@ -82,6 +83,29 @@ php_apache_sapi_ub_write(const char *str
 	return str_length; /* we always consume all the data passed to us. */
 }
 
+/* default php.ini path */
+static int php_ini_path_override(char **val)
+{
+    char *buf = NULL;
+
+    if (getenv("PHPRC")) {
+        *val = buf;
+        return 0;
+    }
+
+    if ((buf = (char *) malloc(MAXPATHLEN)) == NULL) {
+	  errno = ENOMEM;
+	  return -1;
+	}
+		
+    snprintf(buf, MAXPATHLEN, "/etc/php/%d.%d.%d/apache2-mod_php",
+			  PHP_MAJOR_VERSION,
+			  PHP_MINOR_VERSION,
+			  PHP_RELEASE_VERSION);
+    *val = buf;
+    return 0;
+}
+
 static int
 php_apache_sapi_header_handler(sapi_header_struct *sapi_header,sapi_headers_struct *sapi_headers TSRMLS_DC)
 {
@@ -407,6 +431,11 @@ php_apache_server_startup(apr_pool_t *pc
 	/* Set up our overridden path. */
 	if (apache2_php_ini_path_override) {
 		apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override;
+	} else {
+	    if ( php_ini_path_override(&apache2_sapi_module.php_ini_path_override) == -1) {
+		perror("Can't override php.ini path");
+		return NULL;
+	    }
 	}
 #ifdef ZTS
 	tsrm_startup(1, 1, 0, NULL);
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin