Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Run a script remotley on a server.

Discussion in 'cPanel Developers' started by Markspixel, Sep 10, 2010.

  1. Markspixel

    Markspixel Registered

    Sep 8, 2010
    Likes Received:
    Trophy Points:
    Houston, TX
    I have a wordpress autoinstaller which I can run on a cpanel account easily by simply going to the .php file and clicking the submit button. Basically the autoinstaller downloads the latest wordpress version and extracts it to the directory the php file is in.

    Now if I want to run this script on a different server, lets say server A, and I want it to install on an cpanel account on server B, how do i do that?

    I have been reading the documentation, but I am struggling a little, I am familiar with php, but I have never used API's or anything like that.

    The script I am using and the source can be found here: WordPress Loader – A much faster and easier way to get it up there!

  2. MattDees

    MattDees Well-Known Member

    Apr 29, 2005
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Well, looking at this script, it essentially is a very simple script that does the following bit of logic (I used PHP Beautifier to remove it from it's one-line formatting):

        if (!empty($_POST["load"])) {
    $latest "";
    $localfile dirname(__FILE__) . "/";
    $file file_get_contents($latest);
    $fp fopen($localfile"w");
    $archive = new PclZip($localfile);
            if (
    $archive->extract(PCLZIP_OPT_REMOVE_PATH'wordpress') == 0) {
    "Error : " $archive->errorInfo(true));
    "WordPress uploaded and unzipped successfully!";
        } else {
    '<h3>WordPress Uploader/Unzipper</h3><p>WordPress will be uploaded and unzipped into the<br /><em>' dirname(__FILE__) . '</em><br />directory, overwriting any existing WordPress installation.<br />Take care!</p><form action="" method="POST"><input type="hidden" name="load" value="1" /><input type="submit" value="Do it!" /></form><p>--<br />Alister Cameron<br /><a href=""></a></p>';
    Now, we actually offer a more complete solution for install wordpress via our "cPaddons" (Site Software) system. This will install and configure wordpress, including setting up the SQL database.

    There is the ability to use this through the control panel under the "Site Software" section (has to be configured first via WHM's "Install cPAddons")

    If you want to use this remotely, it gets a bit more complicated, but I feel this would offer a better solution for what you're wanting to do vs. using the provided script.

    DavidN has already posted instructions on how to do this here.

    If you need any help, please let us know.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice