• Resolved bpb54321

    (@bpb54321)


    I just installed the Database Sync plugin, and I was able to install and activate it on both my local server and the production server. I was also able to link my production server installation to my local installation.

    However, when I try to pull the database from the local server, I get the following error:

    Remote site not accessible (HTTP 401)

    I believe this is due to the remote site having HTTP authentication enabled (it requires a username and password to access the site itself (not just the WordPress Admin area).

    Is there an easy way to modify the code in the Database Sync plugin to pass this HTTP authentication information to the remote server when trying to the sync the databases?

    https://ww.wp.xz.cn/plugins/database-sync/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bpb54321

    (@bpb54321)

    Just figured it out!

    Referencing this post: https://ww.wp.xz.cn/support/topic/http-406-remote-site-not-accessible?replies=10

    It appears that you can go into the function function dbs_post($url, $action, $params) within the functions.php file of the plugin, and create a $header variable, which you can then add to the CURL request, exactly like rearley did in the above referenced post.

    The only difference needed for me was that I had to add the following to the beginning ofn the $header array:

    $header[0] = "Authorization: Basic *****************";

    Where “*******” represents an authorization key. I was able to find the authorization key for my site by using Dev Tools->Network Panel to read the HTTP request that my browser sent to my remote site after I entered the username and password in the dialog box.

    Plugin Author tamlyn

    (@tamlyn)

    Glad you got it working and thanks for sharing your solution 👍

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to modify Database Sync plugin to use HTTP authentication’ is closed to new replies.