Installing WordPress via shell script(BASH)

We have been using a provisioning script that downloads the latest wordpress zip file, extracts into the right location it and sets up the DB connection. I wanted to take it a step further and eliminate the install.php page. The one that looks like this:Screen_Shot_2013-03-06_at_3.54.19_PM-2

 

So i sat down to figure out how to “Install WordPress” via shell script. Here is that command:

SITENAME="blog"
DOMAINNAME="company.com"
PASSWORD="MySecurePassword"
wp_install_result=$(php -r 'define("WP_SITEURL", "http://'$SITENAME.$DOMAINNAME'");define("WP_INSTALLING", true);require_once("./wp-load.php");require_once("wp-admin/includes/upgrade.php");$response=wp_install("TITLE", admin, "[email protected]", false, null, "'$PASSWORD'");echo $response;')

 
After WordPress is “installed”, we can now activate plugins.

,

Comments are closed.