Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("report_zend_debug", "0", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("register_argc_argv", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("auto_globals_jit", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("short_open_tag", DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals)

Expand Down
2 changes: 1 addition & 1 deletion php.ini-development
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
; Production Value: 4096

; register_argc_argv
; Default Value: On
; Default Value: Off
; Development Value: Off
; Production Value: Off

Expand Down
2 changes: 1 addition & 1 deletion php.ini-production
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
; Production Value: 4096

; register_argc_argv
; Default Value: On
; Default Value: Off
; Development Value: Off
; Production Value: Off

Expand Down
8 changes: 8 additions & 0 deletions sapi/apache2handler/sapi_apache2.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "http_core.h"
#include "ap_mpm.h"

#include "php_ini_builder.h"
#include "php_apache.h"

/* UnixWare define shutdown to _shutdown, which causes problems later
Expand All @@ -61,6 +62,9 @@
#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source"
#define PHP_SCRIPT "php-script"

static const char HARDCODED_INI[] =
"register_argc_argv=0\n";

/* A way to specify the location of the php.ini dir in an apache directive */
char *apache2_php_ini_path_override = NULL;
#if defined(PHP_WIN32) && defined(ZTS)
Expand Down Expand Up @@ -466,6 +470,7 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp
{
void *data = NULL;
const char *userdata_key = "apache2hook_post_config";
struct php_ini_builder ini_builder;

/* Apache will load, unload and then reload a DSO module. This
* prevents us from starting PHP until the second load. */
Expand All @@ -480,6 +485,7 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp
return OK;
}

php_ini_builder_init(&ini_builder);
/* Set up our overridden path. */
if (apache2_php_ini_path_override) {
apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override;
Expand All @@ -499,6 +505,8 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp
zend_signal_startup();

sapi_startup(&apache2_sapi_module);
php_ini_builder_prepend_literal(&ini_builder, HARDCODED_INI);

if (apache2_sapi_module.startup(&apache2_sapi_module) != SUCCESS) {
return DONE;
}
Expand Down
1 change: 1 addition & 0 deletions sapi/fpm/fpm/fpm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@ int main(int argc, char *argv[])
zend_signal_startup();

sapi_startup(&cgi_sapi_module);
php_ini_builder_prepend_literal(&ini_builder, HARDCODED_INI);
cgi_sapi_module.php_ini_path_override = NULL;
cgi_sapi_module.php_ini_ignore_cwd = 1;

Expand Down
Loading