3

Environment: Shared hosting, Apache.

Home directory: /home/someuser

Website at: /home/someuser/public_html/stuff

I've spent 2 days trying to get this to work, and realise that as soon as I'm answered it will be blindingly obvious, but I'm failing miserably right now.

I have created a directory in my public_html directory called private_files with a sub-directory called stuff. Both have access rights 755.

I have edited settings.php to include the line:

# $settings['file_private_path'] 
= '/home/someuser/public_html/private_files/stuff';

I have cleared all caches.

The file system configuration page shows:

Private file system path

Not set

What stunningly stupid mistake am I making? Why is what I'm doing wrong?

3
  • 3
    Is that the line in settings.php verbatim, or have you removed the comment char (#)?
    – Clive
    Commented Aug 21, 2018 at 13:27
  • @Clive I told you it would be blindingly stupid -- after 2 days of trying I'd pretty well gone gaga (and I rarely do anything with PHP anyway -- it's all monkey see monkey do something stupid). If you want to construct an answer pointing out my idiot mistake, I'll accept it -- somebody else might fall into the same idiot trap. Commented Aug 21, 2018 at 13:40
  • Don't beat yourself up over it. Every programmer ever has been through similar things. It's a right of passage. That's what makes the community so great - we can all look stupid to each other, and since we've all done it, we're all ok!
    – Jaypan
    Commented Aug 21, 2018 at 21:52

1 Answer 1

4

In order for this question to be marked as answered, @Clive pointed out here that the problem was the leading # character, which made the 1st line a comment, meaning that the file_private_path was never set.

The correct line should be

$settings['file_private_path'] = '/home/someuser/public_html/private_files/stuff';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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