• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question i m try to create user account using shell_exec but its no working

tariqthaqeeq

New Pleskian
hi team Plesk I m create a web application to create one-click user account create but the problem is that code is not running on Plesk and i m not seeing any error also

$a = shell_exec('curl -k -u username:password-X POST -d @pleskaddclient.json "https://172.105.70.47:8443/api/v2/clients" ');


if(file_exists('pleskaddclient.json'))
{
$current_data = file_get_contents('pleskaddclient.json');
$array_data = json_decode($current_data, true);
$extra = array(
'name' => strtolower($arrUsrfirst),
'login' => strtolower($arrUsrfirst).strtolower($arrUsrsurname),
'password' => "password",
'email' => $arrEmail,
'type' => "customer",
'company' => "TechVento",
);
$array_data = $extra;
$final_data = json_encode($array_data);
if(file_put_contents('pleskaddclient.json', $final_data))
{

$a = shell_exec('curl -k -u username:password -X POST -d @pleskaddclient.json "https://172.105.70.47:8443/api/v2/clients" ');
}
}
else
{
$error = 'JSON File not exits';
}


please check and let me know why it not working

i m using linod vps
 
Last edited:
hi team Plesk I m create a web application to create one-click user account create but the problem is that code is not running on Plesk and i m not seeing any error also

$a = shell_exec('curl -k -u root:WDAhq6kp2@@ -X POST -d @pleskaddclient.json "https://172.105.70.47:8443/api/v2/clients" ');


if(file_exists('pleskaddclient.json'))
{
$current_data = file_get_contents('pleskaddclient.json');
$array_data = json_decode($current_data, true);
$extra = array(
'name' => strtolower($arrUsrfirst),
'login' => strtolower($arrUsrfirst).strtolower($arrUsrsurname),
'password' => "WDAhq6kp2@@",
'email' => $arrEmail,
'type' => "customer",
'company' => "TechVento",
);
$array_data = $extra;
$final_data = json_encode($array_data);
if(file_put_contents('pleskaddclient.json', $final_data))
{

$a = shell_exec('curl -k -u root:WDAhq6kp2@@ -X POST -d @pleskaddclient.json "https://172.105.70.47:8443/api/v2/clients" ');
}
}
else
{
$error = 'JSON File not exits';
}


please check and let me know why it not working

i m using linod vps

PLEASE DELETE YOUR USER/PASSWORD!!!!
 
Back
Top