I'm running Apache 2.4 and PHP 7 on CentOS 7. I run a web-based file server. The directory structure looks like this:
/var/www/example.com/public_html # Document Root
/var/www/file-transfer-center/ # Location of files for file server
Everything works great, but the partition that these files reside on is getting full. There is another partition on the machine:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 953.8G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 953.3G 0 part
├─centos-root 253:0 0 50G 0 lvm /
├─centos-swap 253:1 0 4G 0 lvm [SWAP]
└─centos-home 253:2 0 899.2G 0 lvm /home
sdb 8:16 0 500G 0 disk
└─sdb1 8:17 0 500G 0 part
sdc 8:32 0 1000G 0 disk
└─sdc1 8:33 0 1000G 0 part
sr0 11:0 1 1024M 0 rom
And if I run df -aTh | grep centos
:
/dev/mapper/centos-root xfs 50G 17G 34G 34% /
/dev/mapper/centos-home xfs 899G 34G 866G 4% /home
So it looks to me like I can just move my file-transfer-center
directory to /home
and I'll be all set.
I copied the files and changed the configuration of the path of my file transfer software to /home/file-transfer-center
, but when I try to access the files, php-fpm
gives me the error:
PHP Fatal error: Uncaught LogicException: The root path /home/file-transfer-center is not readable.
I checked the permissions and the file-transfer-center
and all if it's contents are owned by apache
and in the wheel
group with 775 and 664 rights on directories and files, respectively.
I wrote a simple test:
var_dump(fopen('/home/file-transfer-center/fa498800-4102-46be-a7a6-3384f242a949', 'r'));
And it results in false
. If I replace the path in that test with the original file-transfer-center
path, it results in resource(5) of type (stream)
.
I checked open_basedir
, it is not set. Same with user_dir
. I can't find anything that would indicate that the directory would be off limits to PHP.
What am I missing here? Am I correct in my analysis that /home
is running on a separate logical partition of the same physical drive? Does that have something to do with it?
How can I explicitly tell PHP that it's cool to access /home/file-transfer-center
?
EDIT: My web server is running as user apache
and the /home/file-transfer-center
directory is owned by apache
:
drwxrwxr-x. 2 apache wheel 60K Jan 11 17:12 file-transfer-center