Support » Plugin: Duplicator - WordPress Migration & Backup Plugin » Timout error on cloud servers

  • Using Duplicator on Cloud servers usually times out because the load-balancing does not allow for more than 30 seconds of run time. Adding the following ping to keep the tunnel open to the install.php seems to solve the problem for me at least.

    $pipe = popen($cmd, ‘r’);

    if (empty($pipe)) {
    throw new Exception(“Unable to open pipe for command ‘$cmd'”);
    }

    stream_set_blocking($pipe, false);
    echo “\n”;

    while (!feof($pipe)) {
    fread($pipe, 1024);
    sleep(1);
    echo “.”;
    flush();
    }

    echo “\n”;
    pclose($pipe);

    http://wordpress.org/plugins/duplicator/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey JX,

    Thxs for posting that solution! I’m going to try and get the project into github soon and hope to start getting more contributions…

    Cheers~

    Thread Starter jx

    (@jx)

    Glad to help. Thanks for making the plugin. You may have to play around with exactly where to paste it. The first time I tried it it threw an error. Second time, I moved it down in the php and it threw an error but only after it kept the pipe open and the install actually worked perfectly despite the message, so I didn’t really get it exactly right enough for production.

    Thats fine, it can always be tweaked 🙂

    I’m keen to try this. Where exactly should this code be pasted? Which file?

    Thread Starter jx

    (@jx)

    Stick it somewhere in the installer.php file. Maybe after
    * PREG_REPLACEMENT_QUOTE
    somewhere around line 442.

    Our fearless leader may be able to tweak the code so it works as it should. Right now, it works but you get an error message that says:
    “Please try again an issue has occurred.”
    It’s not really true. – Well, it is true, but the install still goes perfectly. The error is that the messages after install do not work, so you have to already know to do things like log in and re-save the permalinks and test the site.

    Tried it – didn’t work. I’ll talk to my hosts about cloud timeouts.

    Thread Starter jx

    (@jx)

    Let us know what they say. Which host are you using? Did you make sure that you pasted it between php tags and not inside some other function? It worked for me on 2 different cloud servers so far.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Timout error on cloud servers’ is closed to new replies.