I am working on a script to creates a database and installs WordPress. I have the database created but I am not sure how to download WordPress and put it in the correct directory.
<?php
function actionhook_AcceptOrder($vars) {
$db = $vars["orderid"];
$con = mysql_connect("localhost","name","pword");
mysql_query("CREATE DATABASE ".$db."_db",$con)or die(mysql_error());
mysql_query("GRANT ALL ON ".$db."_db.* to ".$db."_user identified by '".$db."'",$con) or die(mysql_error());
mkdir("/home/site/public_html/".$db."", 0700);
exec('curl -O http://wordpress.org/latest.tar.gz');
exec("mv latest.tar.gz /home/site/public_html/".$db."");
}
add_hook("AcceptOrder",1,"actionhook_AcceptOrder");
?>
I also tried wget with exec but that didn’t work either.
It’s all about being creative 🙂