DB Connection does not work in Linux
<p>I have this connection to connect to a database. This works on Windows, but does not work in Linux.</p>

<pre><code>&lt;?php class conexion{
private static $instance;

/** @var \mysqli */
public $conexion;
private $server;
private $username;
private $password;
private $database;

/**
 * Devuelve la instancia única de esta clase ya conectada.
 * Así no hay que abrir tantas conexiones a la misma base de datos.
 *
 * @return self
 */
public static function getInstance()
{
    if (isset(self::$instance)) {
        return self::$instance;
    } else {
        $temp = new self();
        $temp-&gt;conectar();
        return self::$instance = $temp;
    }
}

public function __construct()
{
    $this-&gt;server = "localhost";
    $this-&gt;username = "root";
    $this-&gt;password = "";
    $this-&gt;database = "store";
}

public function __destruct()
{
    $this-&gt;conexion-&gt;close();
}

function conectar()
{
    $this-&gt;conexion = new mysqli($this-&gt;server, $this-&gt;username, $this-&gt;password, $this-&gt;database);
}

function cerrar()
{
    $this-&gt;conexion-&gt;close();
}

function query($sql_cmd)
{
    return $this-&gt;conexion-&gt;query($sql_cmd);
}
}
</code></pre>