• 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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter thanatica2

    (@thanatica2)

    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?

    Thread Starter thanatica2

    (@thanatica2)

    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?

    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.

    Thread Starter thanatica2

    (@thanatica2)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Directory not writable?’ is closed to new replies.