• I am currently making the transitions of migrating my wordpress site from a hosted service to our in-house server (Centos 7 server installed). Along with WordPress, I have MariaDB, apache and php. I connect to the fileserver via SFTP on filezilla. Along with the migration, I have also made a fresh install of WordPress for the sake of testing but both have ran into the same issue:

    Plugins and themes are updating and installing fine on both sites with no issues. However when it comes to updating WordPress and it asks for my sftp credentials (using the same credentials i use to connect on filezilla), I am coming up with an error when submitting the credentials on wordpress:

    ERROR: There was an error connecting to the server, Please verify the settings are correct.

    So looking into this issue I have tried the following:

    > Input the following in wp-config, still came back with same error:

    define( 'FTP_USER', 'username' );
    define( 'FTP_PASS', 'password' );
    define( 'FTP_HOST', 'hostname' ); //(tried both IP and hostname)

    > Installed the plugin: ‘SSH SFTP Updater Support’ tried to punch in credentials through that, still above error.

    > Ive read people saying its a file permissions issue, humoring that, it is how I would expect it to be (Directories are 755, files are 644) I have even for testing purposes changed directories to 777, this still doesnt work and I do not regard or recommend changing permissions to 777 as a solution due to the fact it is insecure.

    > While looking into permission, I also checked ownership, for now during initial development I have set it via SSH as:

    chown apache:apache -R /var/www/html/site_name //(site name being wordpress)

    Despite all this, nothing worked from here after been constantly hit by this same error mentioned above.

    There was one thing however which I am not sure if it is a step forward, unrelated or a step backwards. One suggestion I tried was to force the filesystem method using:

    define('FS_METHOD', 'direct'); //within wp-config

    After setting this up, this time when i try to update wordpress i get this:

    Downloading update from https://downloads.www.ads-software.com/release/en_GB/wordpress-4.4.2.zip…

    Unpacking the update…

    The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

    Installation Failed

    And with that, I go full circle and get issues with permissions. Like I said, my directories are 755 and my files are 644, I have chown as apache. Again i have experimented as 777 still no joy and NOT a viable solution.

    For the time being, it seems like I will be using manual wordpress updates as the alternative but this isn’t a resolution to the underlying issue.

    I have searched through various forums and tutorials online with people going through the same situations but none of the suggested solutions have worked for me. If anyone has any other ideas on this it would be a great help.

Viewing 1 replies (of 1 total)
  • This is probably a long shot (or at least something you can rule out) but do you have SELinux enabled? If yes, you may want to investigate the possibility that it’s preventing scripts from connecting to the web via httpd by default.

    If that might be the case, the boolean you’re after might be something similar to setsebool -P httpd_can_network_connect on

    “httpd_can_network_connect ( Allow HTTPD scripts and modules to connect to the network.)”

    You’ll want to do a little research before using that though, just to make sure it actually applies to your circumstances.

    ..just guessing, mind you.

Viewing 1 replies (of 1 total)
  • The topic ‘Errors updating/re-installing wordpress – SFTP & update issues’ is closed to new replies.