patch-sapi_cgi_cgi_main_c 800 B

1234567891011121314151617181920212223242526
  1. $OpenBSD: patch-sapi_cgi_cgi_main_c,v 1.6 2016/12/19 20:35:09 martijn Exp $
  2. --- sapi/cgi/cgi_main.c.orig.port Wed Nov 9 02:22:57 2016
  3. +++ sapi/cgi/cgi_main.c Thu Dec 8 10:55:27 2016
  4. @@ -1749,6 +1749,7 @@ int main(int argc, char *argv[])
  5. char *orig_optarg = php_optarg;
  6. char *script_file = NULL;
  7. int ini_entries_len = 0;
  8. + char *ini;
  9. /* end of temporary locals */
  10. #ifdef ZTS
  11. @@ -1809,7 +1810,12 @@ int main(int argc, char *argv[])
  12. sapi_startup(&cgi_sapi_module);
  13. fastcgi = fcgi_is_fastcgi();
  14. - cgi_sapi_module.php_ini_path_override = NULL;
  15. +
  16. + if ((ini = getenv("PHP_INI_PATH"))) {
  17. + cgi_sapi_module.php_ini_path_override = ini;
  18. + } else {
  19. + cgi_sapi_module.php_ini_path_override = NULL;
  20. + }
  21. #ifdef PHP_WIN32
  22. _fmode = _O_BINARY; /* sets default for file streams to binary */