Skip to content

Instantly share code, notes, and snippets.

@mickaelandrieu
Created November 1, 2013 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mickaelandrieu/7271939 to your computer and use it in GitHub Desktop.
Save mickaelandrieu/7271939 to your computer and use it in GitHub Desktop.
Handle with Softaculous Api in PHP (don't do that at home)
<?php
$new = new Softaculous_API();
$new->login = 'https://user:password@domain.com:2083/frontend/x3/softaculous/index.live.php';
// Domain Name
$data['softdomain'] = 'domain.com'; // OPTIONAL - By Default the primary domain will be used
// The directory is relative to your domain and should not exist. e.g. To install at http://mydomain/dir/ just type dir. To install only in http://mydomain/ leave this empty.
$data['softdirectory'] = 'wp887'; // OPTIONAL - By default it will be installed in the /public_html folder
// Admin Username
$data['admin_username'] = 'admin';
// Admin Pass
$data['admin_pass'] = 'pass';
// Admin Email
$data['admin_email'] = 'admin@domain.com';
// Database
$data['softdb'] = 'wp887';
//Database User Name
$data['dbusername'] = 'wp887';
// DB User Pass
$data['dbuserpass'] = 'wp887';
// Language
$data['language'] = 'en';
// Site Name
$data['site_name'] = 'Wordpess wp887';
// Site Description
$data['site_desc'] = 'WordPress API Test';
// Response
$res = $new->install(26, $data); // Will install WordPress(26 is its script ID)
// Unserialize
$res = unserialize($res);
// Done/Error
if(!empty($res['done'])){
echo 'Installed';
}else{
echo 'Installation Failed<br/>';
if(!empty($res['error'])){
print_r($res['error']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment