我没有open_basedir,php可以访问/ etc /usr/proc / home等…但不是/ tmp.
tmpfs挂载在/ tmp上(/ tmp类型为tmpfs(rw))
这也是我想使用/ tmp文件夹的原因.
我的文件由http(nginx和php的用户)拥有,并且每个人都可读.
sudo -u http cat / tmp / file正在运行但是php脚本中的任何内容都没有(比如file_exist()或file()).
编辑:日志中的错误显示:
PHP Warning: file(/tmp/ydlw/pid): failed to open stream: No such file or directory in /srv/http/ydlw/status.php on line 267
edit2:我用另一种方式测试了这个问题.我做了
touch("/tmp/boo");
file_exist("/tmp/boo");
和file_exist返回true,以便创建文件.然后我在里面看了/ tmp,那里找不到“boo”文件.这就是我所害怕的,php不会“看到”挂载点.为什么这样,我该如何解决?