Tagged with apache

PHP-FPM ignores `upload_tmp_dir` setting

Running Apache 2.4 and PHP-FPM 5.4.16, I noticed that the option upload_tmp_dir was ignored when executing PHP code. phpinfo() shows the correct setting, but for instance sys_get_temp_dir() falls back to the OS' environment setting for the temporary directories as if it weren't set.

To fix this, I had to append a few more lines of config to my PHP-FPM's pool's configuration:

php_admin_value[open_basedir] = /tmp/php-fpm 
php_admin_value[upload_tmp_dir] = /tmp/php-fpm 
env[TMP] = /tmp/php-fpm 
env[TMPDIR] = /tmp/php-fpm 
env[TEMP] = /tmp/php-fpm

Sources

Tagged , ,