[GH-ISSUE #1204] Permission denied when accessing bucket using php #639

Closed
opened 2026-03-04 01:47:26 +03:00 by kerem · 2 comments
Owner

Originally created by @BattleMetalChris on GitHub (Nov 21, 2019).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1204

Additional Information

Version of s3fs being used (s3fs --version)

1.87

Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)

2.9.4

Kernel information (uname -r)

4.4.0-1044-aws

GNU/Linux Distribution, if applicable (cat /etc/os-release)

Ubuntu 16.04.3 LTS

s3fs command line used, if applicable

sudo s3fs pfceventmanager /home/ubuntu/s3fs_files/ -o nonempty -o umask=0000 -o uid=1000,gid=1000

Details about issue

I am running Ubuntu on an Amazon EC2 server.

I've mounted the bucket and everything mostly works.
However, I'm now trying to access the contents of the bucket via php and get permission denied.

I can view the file system in the bucket using a PuTTY session, with user ubuntu
I can view the file system when I connect via WinSCP. I can also use WinSCP to drop files into the mounted folder and they appear in the S3 dashboard. All good.

But when I try and access the mounted folder using php, I get permission denied.
I've tried putting the mounted folder in different places (in /home/, in /etc, even in /var/www) but it makes no difference.
I've tried mounting it using umask=0000
I've tried uid=1000,gid=1000 (1000 is ubuntu)
I've tried uid=33, gid=33 (33 is www-data)

Originally created by @BattleMetalChris on GitHub (Nov 21, 2019). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1204 ### Additional Information #### Version of s3fs being used (s3fs --version) 1.87 #### Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse) 2.9.4 #### Kernel information (uname -r) 4.4.0-1044-aws #### GNU/Linux Distribution, if applicable (cat /etc/os-release) Ubuntu 16.04.3 LTS #### s3fs command line used, if applicable sudo s3fs pfceventmanager /home/ubuntu/s3fs_files/ -o nonempty -o umask=0000 -o uid=1000,gid=1000 ### Details about issue I am running Ubuntu on an Amazon EC2 server. I've mounted the bucket and everything mostly works. However, I'm now trying to access the contents of the bucket via php and get permission denied. I can view the file system in the bucket using a PuTTY session, with user ubuntu I can view the file system when I connect via WinSCP. I can also use WinSCP to drop files into the mounted folder and they appear in the S3 dashboard. All good. But when I try and access the mounted folder using php, I get permission denied. I've tried putting the mounted folder in different places (in /home/, in /etc, even in /var/www) but it makes no difference. I've tried mounting it using umask=0000 I've tried uid=1000,gid=1000 (1000 is ubuntu) I've tried uid=33, gid=33 (33 is www-data)
kerem closed this issue 2026-03-04 01:47:26 +03:00
Author
Owner

@BattleMetalChris commented on GitHub (Nov 21, 2019):

Few more things:

I've tried performing the mount as both user ubuntu and as root, no difference.

However, if I reboot and let the fstab entry remount s3fs instead of using the command line, then it works fine, apache can see the mounted folder.

<!-- gh-comment-id:557049909 --> @BattleMetalChris commented on GitHub (Nov 21, 2019): Few more things: I've tried performing the mount as both user ubuntu and as root, no difference. _However_, if I reboot and let the fstab entry remount s3fs instead of using the command line, then it works fine, apache can see the mounted folder.
Author
Owner

@BattleMetalChris commented on GitHub (Nov 21, 2019):

Fixed it!

I needed to use option -o allow_other

<!-- gh-comment-id:557050978 --> @BattleMetalChris commented on GitHub (Nov 21, 2019): Fixed it! I needed to use option -o allow_other
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#639
No description provided.