0

Piwigo gallery, on apache and php.

The root system is a RAID 128GB. /var/www/html is on the root file system.

Mounted the 320GB hdd to /var/www/html/320 using defaults, it's an ext4 fs.

Put a symlink to it in /var/www/html/galleries which is read by the gallery script so I can upload images to there, then click sync. It gives me the error:

[./galleries/] PWG-ERROR-NO-FS (File/directory read error) PWG-ERROR-NO-FS: The file or directory cannot be accessed (either it does not exist or the access is denied)

chmod 777 set on /dev/sdb1, /var/www/html, and /var/www/html/320 as well as the symlink galleries too. All recursive.

chown apache:apache to everything too.

PHP just can't read/write to it. I tried with and without the symlink, I've tried everything I can think of. Nothing.

Any ideas how I can give apache/php permission to read/write to this drive? With 777 permissions all around it should already be able to.

3
  • do NOT change perms on devices in /dev unless you know what you're doing. You've now granted ALL users of your system access to the raw bytes of the drive, allowing them to suck out (or spit in) ANY data they want on the drive. – Marc B Jun 9 '14 at 20:03
  • I can change it right back, was just a trial to get it working. The entire drive is dedicated to just that directory for storing photos. – Dan Jun 9 '14 at 20:06
  • 1
    i would suggest asking in: serverfault.com – Dagon Jun 9 '14 at 20:11
0

sometimes, depending on Apache's configuration, it's set not to be able to read or write outside its doc-root. It is also possible that it is configured not to follow symlinks (which is done at vhost level).

¿Why don't you mount the new hdd in /var/www/html/galleries directly?

Otherwise, instead of symlinks, try using a bind mount:

mount --bind /var/www/html/320 /var/www/html/galleries

I'm assuming you had no problems accesing /var/www/html/320 from the command line

12
  • I tried directly without the link and then read that the link would help. I'll remove it and try the bind right now. I'll post an update in a couple of minutes. Thanks – Dan Jun 9 '14 at 21:09
  • Still has the same error. I've since tried making apache run under my own account, and also specified the directories in httpd.conf. I've made sure FollowSymLinks is set on everything too. – Dan Jun 9 '14 at 21:11
  • it's now mounted directly to the galleries directory. I've since set apache back to run as apache again too. I'm very confused here. I just can't figure out why it doesn't have permission to read when I'm connected to it now uploading files and folders to the drive to be synced. – Dan Jun 9 '14 at 21:15
  • Please do a df -h in terminal and put the output please :) – martinezjc Jun 9 '14 at 21:19
  • I was looking at Piwigo source code and it seems that the PWG-ERROR-NO-FS error message can be triggered if it can't find some files in the galleries (see line 765). Maybe it's just a poorly described exception and has nothing to do with hdd permissions? – ffflabs Jun 9 '14 at 21:19
-1

Fixed.

Edit /etc/selinux/config and change it to disabled, then reboot the machine. Works now.

1
  • 1
    What did you change to disabled? Please be more specific. – Tog Jun 10 '14 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.