BASH Install Of Wordpress, Without Visiting wp-admin/install.php

Posted by user916825 on Stack Overflow See other posts from Stack Overflow or by user916825
Published on 2012-04-08T11:36:51Z Indexed on 2012/04/09 11:29 UTC
Read the original article Hit count: 305

Filed under:
|
|

I wrote this little BASH script that creates a folder,unzips Wordpress and creates a database for a site.

The final step is actually installing Wordpress, which usually involves pointing your browser to install.php and filling out a form in the GUI.

I want to do this from the BASH shell, but can't figure out how to invoke wp_install() and pass it the parameters it needs:

-admin_email
-admin_password
-weblog_title
-user_name

(line 85 in install.php)

Here's a similar question, but in python

#!/bin/bash

#ask for the site name
echo "Site Name:"
read name
# make site directory under splogs
mkdir /var/www/splogs/$name
dirname="/var/www/splogs/$name"
#import wordpress from dropbox
cp -r  ~/Dropbox/Web/Resources/Wordpress/Core $dirname
cd $dirname
#unwrap the double wrap
mv Core/* ./ 
rm -r Core
mv wp-config-sample.php wp-config.php 
sed -i 's/database_name_here/'$name'/g' ./wp-config.php
sed -i 's/username_here/root/g' ./wp-config.php
sed -i 's/password_here/mypassword/g' ./wp-config.php
cp -r ~/Dropbox/Web/Resources/Wordpress/Themes/responsive $dirname/wp-content/t$
cd $dirname

CMD="create database $name"
mysql -uroot -pmypass -e "$CMD"

How do I alter the script to automatically run the installer without the need to open a browser?

© Stack Overflow or respective owner

Related posts about php

Related posts about Wordpress