playground-tools icon indicating copy to clipboard operation
playground-tools copied to clipboard

WordPress crashes when connecting to MySQL

Open adamziel opened this issue 10 months ago • 5 comments

@zzap's VS Code extension crashed when running a MySQL-connected WordPress. We've narrowed it down to the reproduction case below. It's probably also present in wp-now and Studio – CC @sejas @kozer @wojtekn. It's most likely Asyncify-related, here's a doc page on how to debug and fix those: https://wordpress.github.io/wordpress-playground/architecture/wasm-asyncify Even posting a stack trace here would go a long way.

<?php

$servername = "127.0.0.1";
$username = "username";
$password = "password";
$dbname = "myDb";

// Initialize mysqli instance
$mysqli = mysqli_init();

if (!$mysqli) {
    die('mysqli_init failed');
}

// Establish connection
if (!mysqli_real_connect($mysqli, $servername, $username, $password, $dbname)) {
    die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
}
echo 'Success... ' . $mysqli->host_info . "\n";

$mysqli->close();

adamziel avatar Apr 17 '24 11:04 adamziel