Page 1 of 1

HOWTO: fix sys_get_temp_dir returns /tmp

Posted: Thu Jul 11, 2019 3:44 pm
by ViperBit
hi,
when u use vestacp u cant use sys_get_temp_dir () in php because always it returns /tmp that u cant rely on, especially for creating temp file so u must change it in apache templates.
add

Code: Select all

php_admin_value sys_temp_dir %home%/%user%/tmp
in Directory section of templates in /usr/local/vesta/data/templates/web/apache2 (for ex default.tpl)

Code: Select all

...
<Directory %docroot%>
    AllowOverride All
    Options +Includes -Indexes +ExecCGI
    php_admin_value open_basedir %docroot%:%home%/%user%/tmp
    php_admin_value upload_tmp_dir %home%/%user%/tmp
    php_admin_value session.save_path %home%/%user%/tmp
    php_admin_value sys_temp_dir %home%/%user%/tmp
</Directory>
...
good luck.