0
votes

I've been working on an internal site that has Apache / PHP running.

I have CIFS Mount in a root directory. /filesys/Images/ that points to a file server.

My apache runs under the 'apache' user account. The CIFS is mounted with the user and group of the apache user. (and 777)

When I write a PHP script to read or write from this CIFS mount and run it on the command line (both under normal and apache users) everything is fine.

As soon as I try to call the script from apache things fail. No read or write permissions. My error log will show (for mkdir) 'file exists' although it does not.

My PHPInfo verifies that safe mode is not on.

Any ideas?

1
Also EnableSendfile Off and EnableMMap Off are in the httpd.conf - John Lee
Although the webserver need not access these files directly while servering (only through PHP) I added a <directory> Allow from all directive. - John Lee
It was SELinux! I will see about how to add a restriction rule for this. CIFS mount is system_u:object_r:cifs_t - John Lee
semanage boolean -m --on httpd_use_cifs - John Lee

1 Answers

0
votes

My problem had to do with SELinux and getting that configured properly.

semanage boolean -m --on httpd_use_cifs