0
Good morning, my site is not working and gives the error Fatal error: Call to Undefined Function mysqli_connect() in /home2/amttli84/public_html/conexion.php on line 7
The strange thing is that on my localhost it works perfectly and is the same on the server. I’ve tried changing php.ini, restarting the server and I don’t know what else to try. Follow the connection code.php
<?php
define('DB_HOST', (getenv('DB_HOST')  ?: '127.0.0.1'));
define('DB_USUARIO', (getenv('DB_USUARIO') ?: 'root'));
define('DB_SENHA', (getenv('DB_SENHA') ?: '1234'));
define('DB_NOME', (getenv('DB_NOME') ?: 'amtt'));
$conexao = mysqli_connect(DB_HOST,DB_USUARIO,DB_SENHA,DB_NOME)
    or die ('Não foi possivel conectar'); <?php
And the login file is
    session_start();
    include('conexao.php');
    require_once "recaptchalib.php";
    //se um ou ambos dos campos estiverem vazios, retorna ao index
    if(empty($_POST['usuario']) || empty($_POST['senha'])){
        header('Location: index.php');
        exit();
    }
    $secret = "6LdgJ70UAAAAAAQrtJVIRpZiMlZhkEV_0owP3i_C";
    $response = null;
    $reCaptcha = new ReCaptcha($secret);
    if ($_POST["g-recaptcha-response"]) {
        $response = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
    }
    if ($response != null) {
        //As variaveis recebem os dados vindos através do POST
        $usuarioLogado = mysqli_real_escape_string($conexao,$_POST['usuario']);
        $senha = mysqli_real_escape_string($conexao,$_POST['senha']);
        //Busca no banco de dados se a senha e usuário informado combinam com algum registro
        $query= "select usuario_id, nivel_acesso from usuario where usuario = '{$usuarioLogado}' and senha = md5('{$senha}')";
        $result = mysqli_query($conexao,$query);
        $row = mysqli_num_rows($result);
        $resultadoFull = mysqli_fetch_assoc($result);
        if($resultadoFull['nivel_acesso'] == 'sus'){
            $_SESSION['usuarioSuspenso'] = true;
            header('Location: index.php');
            exit();
        }else
        //verifica se a senha e usuario informados estao corretos
        if($row == 1){
            $_SESSION['usuarioLogado'] = $usuarioLogado;
            $usuarioLogado = $_SESSION['usuarioLogado'];
            $query2 = "select * from usuario where usuario = '{$usuarioLogado}'";
            $result2 = mysqli_query($conexao,$query2);
            $rows = mysqli_fetch_assoc($result2);
            $_SESSION['nomeServidor']=$rows['nome'];
            $_SESSION['idServidor']=$rows['usuario_id'];
            $_SESSION['nivel_acesso']=$rows['nivel_acesso'];
            $administrador=$rows['administrador'];
            if($administrador =='sim'){
                $_SESSION['adm']=true;
            }else if($administrador =='vcg'){
                $_SESSION['vcg']=true;
            } else{
                $_SESSION['usuarioNormal']=true;
            }
            header('Location: painel.php');
            exit();
        } else {
            $_SESSION['nao_autenticado'] = true;
            header('Location: index.php');
            exit();
        }
    }else {
        echo $response;
        $_SESSION['captchaInvalido'] = true;
        header('Location: index.php');
        exit();
    }
  [1]: https://i.stack.imgur.com/uD2X9.png