1

I have Tiki 15.4 running on a shared host - I have a problem with the file galleries feature: Uploading stuff to the file galleries works well, for instance I uploaded a .webm video and then it's listed by the wiki interface as present in the gallery. However I cannot not download or do anyhting else with this or any other files later on.

I get an “unable to acces file” error for all my file galleries when trying to download. I can reproduce this for all new uploads.

How can I diagnose what’s happening? I tried these things:

  1. tiki-syslog.php only logged my admin login/logout.
  2. I activated recording and showing for all file archives/file events and generated an action report. Here it shows that I downloaded files, but nothing about errors/failures.
  3. I checked the database in PHPmyadmin, all tables result ok.

EDIT:

  1. I also enabled debug mode, the php messages I'm getting seem to be non-critical, i.e. they shouldn't hint at something that impairs functionality.

EDIT 2: There may be a problem with permissions to access the folder where the files should be saved. Tiki has two options for file galleries: they can be saved either in a web directory or in the database. At setup, I chose to save them in a directory. Tiki documentation says, this directory should not be directly accessible. This can be accomplished in two ways:

  • Use a directory outside your webserver document root, make sure your php script can read and write to that directory
  • Use a directory inside the document root and use .htaccess to prevent the user from listing the directory contents

The folder I specified is inside the DocumentRoot (I think), i.e. it is under Tiki's root directory: tiki-15.4/files, so I believe PHP should have permission to read/write there. I made no changes to the permissions, and I'm not sure if I even can (or how) on this shared host.

Current permissions are:

e42604@web06:~$ ls -ld html/apps/tiki-15.4/files
drwxr-xr-x 4 e42604 e42604 4096 Jan 21  2017 html/apps/tiki-15.4/files

e42604 is my ssh user. I don't know if it's identical to the web server user, but I guess it should be, yes?

These are the permissions on the web root:

e42604@web06:~$ ls -ld      
drwxr-x--- 13 e42604 www-data 4096 Jan  3 21:09 .

I checked the folder I specified to upload all files to (tiki-15.4/files) through FTP, and it did not contain the files I had uploaded, although they were all listed as being there in the wiki interface.

However, when I choose to store file galleries in the database, it works: I can upload stuff and download it again.

I could just go with this as a solution, but I'd prefer finding out how to store the files in a web folder.

Ben Opp
  • 247
  • 4
  • 12
  • Btw I already posted this issue in Tiki forums, got 40 views but no replies in several days. – Ben Opp Dec 28 '17 at 23:57
  • Are you saying you can view the uploaded files at any time, but not download them? That would be truly strange, since viewing and downloading are effectively the same thing. –  Dec 29 '17 at 14:04
  • No, viewing doesn't work either. Just uploading. The only time I was able to view a file was that video directly after uploading. I'm guessing it is a preview? The screen did not change after that. – Ben Opp Dec 29 '17 at 16:13
  • Can you ssh into the shared host and run commands like `locate` or `find` to see where your files might be going? I suspect a simple path error somewhere. –  Dec 29 '17 at 16:14
  • I just tried it again: The video preview actually works *before* pressing the upload button, so it must be previewing the local copy. Also, this didn't work with an .mp4 file. A second .webm did work. – Ben Opp Dec 29 '17 at 16:20
  • ssh-ing in should be possible, but it's sorta not working at the moment. Contacted the hoster about it. But when I get it to work, what exactly would I be looking for? Do I just run "locate filename.ext"? – Ben Opp Dec 29 '17 at 16:49
  • Yes, if locate/mlocate is installed, that should work. if not `find / -iname '*filename*'` should work, but will take longer. –  Dec 29 '17 at 18:52
  • ssh was not necessary to perform that search, was it? I checked via FTP if the the files were in the directory I had configured at setup, and they were not. See new information in OP. – Ben Opp Jan 03 '18 at 22:36
  • I was thinking maybe the files were stored outside your web root AND outside your home dir in some special location in the filesystem. That's where FTP might not find them. However, since that's not the case, the obvious question: what are the ownership and permissions of the directory `tiki15.4/files`? If FTP won't tell you, `ls -ld tiki15.4/files` should. –  Jan 04 '18 at 01:53
  • posted permissions. – Ben Opp Jan 04 '18 at 11:58
  • The www-data user has no write access to `html/apps/tiki-15.4/files`. One way to fix this `chgrp www-data html/apps/tiki-15.4/files; chmod g+w html/apps/tiki-15.4/files`. –  Jan 04 '18 at 16:42
  • It seems I don't have permission to run chgrp, I can't sudo. I also tried usermod, which isn't even installed. – Ben Opp Jan 05 '18 at 14:01
  • The other option is `chmod a+w html/apps/tiki-15.4/files` just briefly as a test, but you wouldn't want to keep the permissions that way long-term. –  Jan 05 '18 at 20:45

0 Answers0