A site reports “open_basedir restriction in effect”
A site fails to write a file under /tmp, and PHP logs open_basedir restriction in effect. You can fix the write by using the site's own temporary folder or changing a domain setting.
Symptoms
The domain's PHP log, shown by urbestack-domain-log --name example.com --type php, contains both lines.
[30-Nov-2026 08:26:55 UTC] PHP Warning: file_put_contents(): open_basedir restriction in effect. File(/tmp/notes-ob.txt) is not within the allowed path(s): (/home/USER/files:/usr/share/php) in /home/USER/files/web/example.com/public_html/ob.php on line 1
[30-Nov-2026 08:26:55 UTC] PHP Warning: file_put_contents(/tmp/notes-ob.txt): Failed to open stream: Operation not permitted in /home/USER/files/web/example.com/public_html/ob.php on line 1Cause
UrbeStack sets the domain's open_basedir to allow only its owner's home, /home/USER/files, and /usr/share/php. PHP refuses paths outside those folders, including the shared /tmp.
PHP uses /home/USER/files/tmp for uploads, sessions, and its own temporary files. The restriction on the shared /tmp affects only sites that write to a literal path under /tmp.
Resolution
Set the application's temporary folder to
/home/USER/files/tmp, or have the application usesys_get_temp_dir(), which returns that folder.If the application needs the shared
/tmp, only an administrator can give the domain's PHP access to it.urbestack-domain-set --name example.com --php-setting open_basedir_tmp=onRetry the file write after either change. To disable access to the shared
/tmpagain, useopen_basedir_tmp=off.