From 0f14f536782fe415b6e62b58be9cf352ea9f0b00 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 9 Sep 2012 13:17:29 +0200 Subject: php-eaccelerator: try to improve cache management --- php-eaccelerator-cache.patch | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 php-eaccelerator-cache.patch (limited to 'php-eaccelerator-cache.patch') diff --git a/php-eaccelerator-cache.patch b/php-eaccelerator-cache.patch new file mode 100644 index 0000000..c0358a8 --- /dev/null +++ b/php-eaccelerator-cache.patch @@ -0,0 +1,40 @@ +--- eaccelerator.c.cache 2012-09-09 11:49:26.000000000 +0200 ++++ eaccelerator.c 2012-09-09 13:07:04.000000000 +0200 +@@ -1521,13 +1521,13 @@ + ZEND_INI_ENTRY1("eaccelerator.shm_ttl", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateLong, &ea_shm_ttl) + ZEND_INI_ENTRY1("eaccelerator.shm_prune_period", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateLong, &ea_shm_prune_period) + ZEND_INI_ENTRY1("eaccelerator.debug", "1", PHP_INI_SYSTEM, eaccelerator_OnUpdateLong, &ea_debug) +-STD_PHP_INI_ENTRY("eaccelerator.log_file", "", PHP_INI_SYSTEM, OnUpdateString, ea_log_file, zend_eaccelerator_globals, eaccelerator_globals) ++STD_PHP_INI_ENTRY("eaccelerator.log_file", "", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, ea_log_file, zend_eaccelerator_globals, eaccelerator_globals) + STD_PHP_INI_ENTRY("eaccelerator.check_mtime", "1", PHP_INI_SYSTEM, OnUpdateBool, check_mtime_enabled, zend_eaccelerator_globals, eaccelerator_globals) + ZEND_INI_ENTRY1("eaccelerator.shm_only", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateBool, &ea_scripts_shm_only) + #ifdef WITH_EACCELERATOR_INFO + STD_PHP_INI_ENTRY("eaccelerator.allowed_admin_path", "", PHP_INI_SYSTEM, OnUpdateString, allowed_admin_path, zend_eaccelerator_globals, eaccelerator_globals) + #endif +-STD_PHP_INI_ENTRY("eaccelerator.cache_dir", "/tmp/eaccelerator", PHP_INI_SYSTEM, OnUpdateString, cache_dir, zend_eaccelerator_globals, eaccelerator_globals) ++STD_PHP_INI_ENTRY("eaccelerator.cache_dir", "/tmp/eaccelerator", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, cache_dir, zend_eaccelerator_globals, eaccelerator_globals) + PHP_INI_ENTRY("eaccelerator.filter", "", PHP_INI_ALL, eaccelerator_filter) + PHP_INI_END() + +@@ -1766,17 +1766,12 @@ + int status = stat(cache_path, &buffer); + + if (status == 0) { +- // check permissions +- if (buffer.st_mode != 777) { +- status = chmod(cache_path, 0777); +- if (status < 0) { +- ea_debug_error( +- "eAccelerator: Unable to change cache directory %s permissions\n", +- cache_path); +- } +- } ++ // probaly created by us (so with 777) ++ // or by sysadmin, which know what we need + } else { + // create the cache directory if possible ++ // use 777 to allow other user to create subdir ++ // which seems acceptable under /tmp (default value) + status = mkdir(cache_path, 0777); + if (status < 0) { + ea_debug_error("eAccelerator: Unable to create cache directory %s\n", cache_path); -- cgit