Support » Fixing WordPress » WordPress Auto-update failing

  • Resolved clockticks

    (@clockticks)


    I am root on my linux box, running the latest Centos.. totally having issues getting auto-update to work.

    I am trying to update to the latest version by selecting “Update Automatically”. I have my ftp server and user setup, I can establish a connection and FTP is working just dandy.

    The error I am receiving in WordPress is:

    Downloading update from http://wordpress.org/wordpress-3.1.zip…
    Unpacking the update…
    Could not copy files.
    Installation Failed

    I found a ton Googling and have messed with it for about 3 hours now and getting kind of frustrated.

    So far I have tried:

    chown root -R /var/*
    chmod 777 /var/*
    Deleting the wp-content/upgrade folder and letting it re-create it when I try to update automatically (this works and creates the folder but fails at the same error above).

    I have added the following to wp-config.php per several instructions:

    if(is_admin()) {
    add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ ));
    define( ‘FS_CHMOD_DIR’, 0751 );
    }

Viewing 7 replies - 1 through 7 (of 7 total)
  • bleeber

    (@bleeber)

    chown root -R /var/*
    chmod 777 /var/*

    Unfortunately, you likely broke a lot more that you could have ever hoped to fix with those commands.

    You should make a backup of your wordpress installation and your database and look to reinstalling you server soon.

    Thread Starter clockticks

    (@clockticks)

    bleeber,

    Thanks for the reply, could you elaborate a little though to help me understand?

    bleeber

    (@bleeber)

    Sure thing.

    /var holds a lot of important information on a unix/linux based system. In var, you will find things such as logs, mail, crons, lockfiles, pidfiles, etc, etc. Each one of these files has a specific owner/group and file permissions that are needed for the program to work.

    What you did, made every file now be owned by root. That’s not a good thing. Then you made every folder inside /var writable by anyone, including malicious users. Not only did you leave a huge location on disk for malicious users to store their own goodies, since /var/log/ can now be written to by anyone, they can also alter the logs on their way out.

    In my professional opinion, I would backup your data, and reinstall. It would be much faster than trying to analyze all of the files that you have modified.

    Thread Starter clockticks

    (@clockticks)

    Thanks, aside from that though does anyone know why I may not be able to update? ftp user is root and like I said it creates the upgrade folder no problem (no files in it however).

    Thread Starter clockticks

    (@clockticks)

    So I went back to a fresh install of everything, I am following the instructions here:

    http://codex.wordpress.org/Upgrading_WordPress

    It mentions all I need to do is click “Update Automatically” and I should be good to go but I am being prompted for an FTP connection method.

    Note that your files all need to be owned by the user under which your Apache server executes, or you will receive a dialog box asking for “connection information,” and you will find that no matter what you enter, you won’t be able to update.

    So I ran: ps auxw | grep -E ‘http|apache|www’

    and got the following:

    ## ps auxw | grep -E ‘http|apache|www’
    root 3710 0.0 1.1 25036 7216 ? Ss 16:21 0:00 /usr/sbin/httpd
    apache 3712 0.0 2.9 36996 18280 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3713 0.0 0.6 25036 4152 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3714 0.0 0.5 25036 3420 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3715 0.0 0.5 25036 3420 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3716 0.0 0.5 25036 3420 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3717 0.0 0.5 25036 3420 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3718 0.0 0.5 25036 3420 ? S 16:21 0:00 /usr/sbin/httpd
    apache 3719 0.0 0.5 25036 3420 ? S 16:21 0:00 /usr/sbin/httpd
    root 3864 0.0 0.1 5352 648 pts/0 S+ 16:29 0:00 grep -E http|apache|www

    Also, I have tried chown -hR /var/www/html/wordpress/* (my wp install) as well as chmod 777 /var/www/html/wordpress/*

    I’m probably being retarded here but I would really like to get out of the special Olympics and be a real contender.

    Thread Starter clockticks

    (@clockticks)

    Solved!

    All I did was:

    chown -Rh apache /var/www/html/wordpress/

    Where /wordpress was my fresh WP install.

    bleeber

    (@bleeber)

    I hate to keep harping on your decisions and I am glad you were able to get it working but chmod’ing your entire wordpress installation 777 is still not a good idea. If there is ever a bug in either wp core or a plugin you use, your system is open for business.

    This link should point you in the right direction.

    http://codex.wordpress.org/Hardening_WordPress#File_permissions

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress Auto-update failing’ is closed to new replies.