Content of /tmp is not visible from PHP-FPM when using Systemd

限于喜欢 提交于 2019-12-11 08:20:03

问题


Directory /tmp is not accessible from PHP-FPM running as Systemd service.

Steps to reproduce:

<?php
print_r(shell_exec('ls /tmp'));
?>

回答1:


This is default behaviour set by package maintainers. It's because there is PrivateTmp=true in /usr/lib/systemd/system/php-fpm.service.

If you want to change it, you can create /etc/systemd/system/php-fpm.service.d/private-tmp.conf with contents:

[Service] PrivateTmp=false



来源:https://stackoverflow.com/questions/21615786/content-of-tmp-is-not-visible-from-php-fpm-when-using-systemd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!