"Server Hangup" errors, "502 Bad Gateway", "err_empty_response" after creating a subdomain with xmlapi

0

The server shows me "Server Hangup", "502 Bad Gateway", "err_empty_response",  these messages after creating a subdomain from php with xmlapi. The information is registered in the database and the subdomain is created perfectly, only then it shows me that error. I'm working with codeigniter.

I think it's a server configuration, because it works fine on my local machine. But I do not know what it is. How could I solve it?

This is my code

$dominio = 'midominio';
//cargo la libreria
$this->load->library('Cpanel_Api');

$cpanelusr = 'minombreusuario';//nombre del usuario cPanel
$cpanelpass = 'miclave';//Contraseña del usuario cPanel
$xmlapi = new xmlapi('mihost');

$xmlapi->set_port(2083);//Puerto
$xmlapi->password_auth($cpanelusr, $cpanelpass);//Autenticacion en cPanel

$xmlapi->set_debug(1); //Salida de errores 1= verdadero
$json = $xmlapi->set_output('json');

$result = $xmlapi->api1_query($cpanelusr, 'SubDomain', 'addsubdomain', array($Tie_Subdominio, $dominio, 0, 0, 'carpeta'));//Creamos el subdominio

$array = json_decode($result);//Convierte en un array los datos json enviados por la API

if ($array->postevent->result == 1)
 {
     if ($result)
     {
       //aqui redirecciono a un enlace dentro de mi pagina
     }
    else
    {
       $errors = "No se pudo crear el subdominio.";
    }
 }
 else
 {
    $errors = $errors_api;
 }
    
asked by Asgu95 01.10.2018 в 01:06
source

0 answers