• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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