From 61bd1f9b35168ae2eb82085c8d0306c46ca22152 Mon Sep 17 00:00:00 2001 From: Falko Timme <ft@falkotimme.com> Date: Fri, 28 Nov 2014 12:14:51 +0100 Subject: [PATCH] - Implemented FS#2653 - Set TMP, TMPDIR and TEMP environment variable. --- server/conf/php-cgi-starter.master | 4 ++++ server/conf/php-fcgi-starter.master | 3 +++ server/conf/php_fpm_pool.conf.master | 4 ++++ server/conf/vhost.conf.master | 3 +++ 4 files changed, 14 insertions(+) diff --git a/server/conf/php-cgi-starter.master b/server/conf/php-cgi-starter.master index be30993221..03d0554a57 100644 --- a/server/conf/php-cgi-starter.master +++ b/server/conf/php-cgi-starter.master @@ -4,6 +4,10 @@ export PHPRC="<tmpl_var name='php_ini_path'>" </tmpl_if> +export TMP=<tmpl_var name='document_root'>/tmp +export TMPDIR=<tmpl_var name='document_root'>/tmp +export TEMP=<tmpl_var name='document_root'>/tmp + exec <tmpl_var name='php_cgi_bin'> \ -d open_basedir=<tmpl_var name='open_basedir'> \ -d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \ diff --git a/server/conf/php-fcgi-starter.master b/server/conf/php-fcgi-starter.master index 92edf86c53..679f1b21ab 100644 --- a/server/conf/php-fcgi-starter.master +++ b/server/conf/php-fcgi-starter.master @@ -9,6 +9,9 @@ export PHP_DOCUMENT_ROOT # export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=<tmpl_var name='php_fcgi_max_requests'> export PHP_FCGI_MAX_REQUESTS +export TMP=<tmpl_var name='document_root'>/tmp +export TMPDIR=<tmpl_var name='document_root'>/tmp +export TEMP=<tmpl_var name='document_root'>/tmp exec <tmpl_var name='php_fcgi_bin'> \ <tmpl_if name="security_level" op="==" value="20"> -d open_basedir="<tmpl_var name='open_basedir'>" \ -d disable_functions="" \ diff --git a/server/conf/php_fpm_pool.conf.master b/server/conf/php_fpm_pool.conf.master index 7f5c8e13c7..d7a34786f1 100644 --- a/server/conf/php_fpm_pool.conf.master +++ b/server/conf/php_fpm_pool.conf.master @@ -28,6 +28,10 @@ pm.max_requests = <tmpl_var name='pm_max_requests'> chdir = / +env[TMP] = <tmpl_var name='document_root'>/tmp +env[TMPDIR] = <tmpl_var name='document_root'>/tmp +env[TEMP] = <tmpl_var name='document_root'>/tmp + <tmpl_if name='security_level' op='==' value='20'> <tmpl_var name='enable_php_open_basedir'>php_admin_value[open_basedir] = <tmpl_var name='php_open_basedir'> php_admin_value[session.save_path] = <tmpl_var name='document_root'>/tmp diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 955b18a31a..e7a50356a1 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -204,6 +204,9 @@ <tmpl_if name='php' op='==' value='mod'> # mod_php enabled AddType application/x-httpd-php .php .php3 .php4 .php5 + SetEnv TMP <tmpl_var name='document_root'>/tmp + SetEnv TMPDIR <tmpl_var name='document_root'>/tmp + SetEnv TEMP <tmpl_var name='document_root'>/tmp php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>" php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp php_admin_value session.save_path <tmpl_var name='document_root'>/tmp -- GitLab