Welcome! Log In Create A New Profile

Advanced

[OT] Cant write across filesystem mounts?

E.B.
May 30, 2015 05:22PM
Hi I dont think this is specific to nginx but I hope its a good
place to ask!

When running PHP script through Nginx it writes OK to files
on the same disk mount where the PHP file is located but
not to the other parts of the system that are on another mount.
(well i dont know if its a matter of "same mount" or not, but
that is how it is behaving)

Example, /tmp is on another mount than the web root.

<?php
ini_set('display_errors', 'On');
file_put_contents('/tmp/test', 'hello world');
system('touch /tmp/test-touch');
file_put_contents('/webroot/tmp/test', 'hello world');
system('touch /webroot/tmp/test-touch');
?><html><body>hello world</body></html>

I run this script from CLI (sudo as ANY user including the php
user) and it always works fine (writes files in both places). If I
access it from a browser the write/touch commands to /tmp
fail silently.

No AVC from selinux, no PHP or Nginx errors or warnings.
/tmp permissions are usual 777. Can someone help me in
right direction?

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

[OT] Cant write across filesystem mounts?

E.B. May 30, 2015 05:22PM

Re: [OT] Cant write across filesystem mounts?

Maxim Dounin June 01, 2015 11:32AM

Re: [OT] Cant write across filesystem mounts?

E.B. June 01, 2015 01:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready