• I’m trying to write some code to install wordpress from a CLI script. I have a number of sites to setup and going to through installer for each one is tedious.

    After generating the appropriate wp-config.php, my script looks like this…but it doesn’t seem to work. Ideas?

    #!/usr/bin/php -q
    <?php
    include ('/web/www.example.com/html/wp-load.php');
    include ('/web/www.example.com/html/wp-admin/install.php');
    $result = wp_install('/web/www.example.com/html/', 'dbname', 'someone@example.com', 1, '', 'password');
    extract( $result, EXTR_SKIP );
    print "result was $result\n";
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, this is very interesting what you are trying to do. I am not too knowledgeable in scripting. I am just curious to know how you are going to setup many sites with one script, to install each individual site and assign a user name, a database and a domain name per site plus assign a folder name or root installation; sounds challenging to me. I am keen to see the end result. Sorry if I am not any help but I am curious as to how you are going to achieve this.

    Kind regards

    Have a look at this link http://codex.wordpress.org/Installing_Multiple_Blogs

    I think this link will help you with your question.

    Kind regards

    In what way doesn’t it work? Any errors? Does it do something?

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

The topic ‘Installing WordPress from a CLI script’ is closed to new replies.