WordPress.org

Ready to get started?Download WordPress

Forums

Public_html permissions question (5 posts)

  1. prairieprog
    Member
    Posted 6 years ago #

    Probably a dumb question. I installed the latest version (0.5.3). On the configuration page, I get a warning message that my public_html file is writeable and that I should change it to read only.

    The permissions for my public_html file (which contains my WP installation) is set to 755. If I change it to 754 or 744, I get a 404 Access Forbidden error when I try to log in to or access the site. Don't I need the owner permissions to be Read, Write, Execute? Why is Super Cache concerned about the public_html file being writeable if it is only writeable by the owner? Should I be concerned about the current settings and, if so, what should they be?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    It does that on mine too. I know better, so I ignore it.

    The short version is that it uses the PHP function is_writable() to determine that, and that function is not particularly accurate.

    Note that depending on your configuration, the webserver, when running PHP, may be running as you, with your access permissions. So a 755 could be writable to the webserver running as you. Set the permissions to 555 and see if that makes the message go away.

  3. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Otto42 - maybe it needs a "I know already, go away" button to hide this message?

    I still shudder to think that someone's web directory would be writeable by the web server!

  4. prairieprog
    Member
    Posted 6 years ago #

    Interestingly, I cannot change the permissions to 555 using my FTP client. It reverts to/stays at 755. (I have not tried with the web host's File Manager function).

    Perhaps I misunderstand all this, but if the server will not allow me to change permissions to that directory via FTP, would that indicate the directory is writeable by the server?

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    donncha: Consider the use of suexec on many webservers. This allows the PHP apps to run as the user, and thus they get the users own permissions.

    prairieprog: Hard to say. Write a simple PHP program that attempts to create and write to a file in that directory, then run it through the website. That'll tell you for sure.

    Example:

    <?php
    file_put_contents('./testfile.txt', 'This directory is writable');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic