• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

urgent. I need help to install wordpress

jose_maria

New Pleskian
I have a file that creates subscriptions , customers and domains. moreover, also installed wordpress to new domain. it makes it through the php file .

The problem I have is that when installing wordpress on plesk domain is installed in a subdirectory called wordpress in the root directory instead .
Is there any way of changing the php file that is installed directly to root ?

ask this because from the plesk panel is done, there is an option through the file but can not.
 
this is the part of the file dedicated to installing wordpress:

public function install_wordpress($params){
$xmldoc = new DomDocument('1.0', 'UTF-8');
$xmldoc->formatOutput = true;

$packet = $xmldoc->createElement('packet');
$packet->setAttribute('version', '1.6.6.0');
$xmldoc->appendChild($packet);

$aps = $xmldoc->createElement('aps');
$packet->appendChild($aps);

$install = $xmldoc->createElement('install');
$aps->appendChild($install);

//$install->appendChild($xmldoc->createElement('',$params['domain-name']));

$package = $xmldoc->createElement('package');
$install->appendChild($package);

$package->appendChild($xmldoc->createElement('name',$params['name-app']));
$package->appendChild($xmldoc->createElement('version',$params['version-app']));
$package->appendChild($xmldoc->createElement('release',$params['release-app']));
$package->appendChild($xmldoc->createElement('vendor',$params['vendor-app']));
$package->appendChild($xmldoc->createElement('packager',$params['packager-app']));

$database=$xmldoc->createElement('database');
$install->appendChild($database);

$domSinTld=substr($params['name-dominio'],0,strpos($params['name-dominio'],'.'));
//$namedb="wp_".$domSinTld;
$passdb="admin";//$this-> rand_string(7);
$database->appendChild($xmldoc->createElement('name',$namedb));
$database->appendChild($xmldoc->createElement('login',$namedb));
$database->appendChild($xmldoc->createElement('password',$passdb));
$database->appendChild($xmldoc->createElement('server',$params['ip-subscripton']));
//$database->appendChild($xmldoc->createElement('prefix','wp_'));

$settings = $xmldoc->createElement('settings');
$install->appendChild($settings);

$setting = $xmldoc->createElement('setting');
$settings->appendChild($setting);

$nameadmin="admin_".$domSinTld;
$passadminwp=$this->rand_string(5);
$setting->appendChild($xmldoc->createElement('name',$nameadminwp));
$setting->appendChild($xmldoc->createElement('value',$passadminwp));


/*$filter = $xmldoc->createElement('filter');
$switchSubscription->appendChild($filter);

$filter->appendChild($xmldoc->createElement('name',$params['name-subscription']));
$switchSubscription->appendChild($xmldoc->createElement('plan-guid',$params['plan-guid']));*/

return $xmldoc;

}
public function install_from_aps($params){
$xmldoc = new DomDocument('1.0', 'UTF-8');
$xmldoc->formatOutput = true;

$packet = $xmldoc->createElement('packet');
$packet->setAttribute('version', '1.6.6.0');
$xmldoc->appendChild($packet);

$aps = $xmldoc->createElement('aps');
$packet->appendChild($aps);

$install = $xmldoc->createElement('install');
$aps->appendChild($install);


$install->appendChild($xmldoc->createElement('domain-name',$params['name-dominio']));
$install->appendChild($xmldoc->createElement('package-id',$params['package-id']));


$settings = $xmldoc->createElement('settings');
$install->appendChild($settings);

$setting1 = $xmldoc->createElement('setting');
$settings->appendChild($setting1);

$setting2 = $xmldoc->createElement('setting');
$settings->appendChild($setting2);


$emailadminwp="admin_wp@".$params['name-dominio'];
$passadminwp=$this->rand_string(5);
$setting1->appendChild($xmldoc->createElement('name','admin_email'));
$setting1->appendChild($xmldoc->createElement('value',$emailadminwp));

$setting2->appendChild($xmldoc->createElement('name','admin_password'));
$setting2->appendChild($xmldoc->createElement('value',$passadminwp));

return $xmldoc;

}
function rand_string( $length ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$size = strlen( $chars );
$str="";
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}

return $str;
}

function get_packages(){
$xmldoc = new DomDocument('1.0', 'UTF-8');
$xmldoc->formatOutput = true;

$packet = $xmldoc->createElement('packet');
$packet->setAttribute('version', '1.6.6.0');
$xmldoc->appendChild($packet);

$aps = $xmldoc->createElement('aps');
$packet->appendChild($aps);

$getpackageslist = $xmldoc->createElement('get-packages-list');
$aps->appendChild($getpackageslist);

$getpackageslist->appendChild($xmldoc->createElement('all'));;

return $xmldoc;

}

function download_package($params){

$xmldoc = new DomDocument('1.0', 'UTF-8');
$xmldoc->formatOutput = true;

$packet = $xmldoc->createElement('packet');
$packet->setAttribute('version', '1.6.6.0');
$xmldoc->appendChild($packet);

$aps = $xmldoc->createElement('aps');
$packet->appendChild($aps);

$downloadpackage = $xmldoc->createElement('download-package');
$aps->appendChild($downloadpackage);

$package = $xmldoc->createElement('package');
$downloadpackage->appendChild($package);

$package->appendChild($xmldoc->createElement('name',$params['name-app']));
$package->appendChild($xmldoc->createElement('version',$params['version-app']));
$package->appendChild($xmldoc->createElement('release',$params['release-app']));
$package->appendChild($xmldoc->createElement('vendor',$params['vendor-app']));
//$package->appendChild($xmldoc->createElement('packager',$params['packager-app']));

//$downloadpackage->appendChild($xmldoc->createElement('aps-catalog-url',$params['aps-catalog-url']));

return $xmldoc;
}

function download_status($params){

$xmldoc = new DomDocument('1.0', 'UTF-8');
$xmldoc->formatOutput = true;

$packet = $xmldoc->createElement('packet');
$packet->setAttribute('version', '1.6.6.0');
$xmldoc->appendChild($packet);

$aps = $xmldoc->createElement('aps');
$packet->appendChild($aps);

$getdownloadstatus = $xmldoc->createElement('get-download-status');
$aps->appendChild($getdownloadstatus);

$filter = $xmldoc->createElement('filter');
$getdownloadstatus->appendChild($filter);

$filter->appendChild($xmldoc->createElement('task-id',$params['task-id']));

//$downloadpackage->appendChild($xmldoc->createElement('aps-catalog-url',$params['aps-catalog-url']));

return $xmldoc;
}
 
Back
Top