WordPress.org

Ready to get started?Download WordPress

Forums

Directory not writable? (5 posts)

  1. thanatica2
    Member
    Posted 1 year ago #

    I'm trying to update WordPress from the web interface. Doesn't work, it asks for FTP settings, but I don't use FTP. I need wordpress to update itself.

    The directory that wordpress sits in, is writable, afaik.

    the www directory itself (perm/user/group):
    drwxrws--- martijn www

    ALL subdirectories on all levels:
    drwxrws--- martijn www

    ALL files in it and in all subdirectories:
    -rw-rw---- martijn www

    martijn is just the owner. No problems there. www is group that has the www-data user as one of its members. www-data is the user that Apache starts with (I'm not sure how standardized this is, but it's the default for my Ubuntu box).

    This in my mind makes the entire www directory writable. Why can WordPress not write in it?

    Is there a logfile that tells me WHY it cannot write? Otherwise, I'm stuck. What do I do now?

  2. thanatica2
    Member
    Posted 1 year ago #

    Note that I can edit permalink structure and edit theme css perfectly fine. This proves the directories are writable. So why can WordPress not update itself?

  3. thanatica2
    Member
    Posted 1 year ago #

    Okay, I may have discovered something here.

    This is in /wp-admin/includes/file.php :

    if ( ! $method && function_exists('getmyuid') && function_exists('fileo$
                    if ( !$context )
                            $context = WP_CONTENT_DIR;
                    $context = trailingslashit($context);
                    $temp_file_name = $context . 'temp-write-test-' . time();
                    $temp_handle = @fopen($temp_file_name, 'w');
                    if ( $temp_handle ) {
                            if ( getmyuid() == @fileowner($temp_file_name) )
                                    $method = 'direct';
                            @fclose($temp_handle);
                            @unlink($temp_file_name);
                    }
            }

    This is wrong, because the script check whether the newly-created tempfile is owned by the user that apache is running as. This will never happen in my scenario.

    Why does a newly-created file need to be owned by the user apache is running as? I don't want or need that, and neither does WordPress. By creating a file (and having it succeed) write-access is proven to be in order. No need to see who owns the file.

    Can this please be fixed?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Doesn't work, it asks for FTP settings, but I don't use FTP

    You can add your FTP details to your wp-config.php. FWIW, this is a server configuration issue - not a WordPress one.

  5. thanatica2
    Member
    Posted 1 year ago #

    You're missing the point. Using FTP or not has nothing to do with it.

    The issue is that WordPress thinks the directories are not writable, but they are. This IS a WordPress issue, iyam.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.