What are common issues when running Xampp on a MacBook for PHP development?

Issue: One common issue when running Xampp on a MacBook for PHP development is the "mysqli_connect(): (HY000/2002): Connection refused" error, which occurs when trying to connect to the MySQL database. This error is often caused by the MySQL server not running or a misconfiguration in the connection settings. To solve this issue, make sure that the MySQL server is running in Xampp and check the connection settings in your PHP code to ensure they are correct.

$servername = "localhost";
$username = "root";
$password = "";
$dbname = "database_name";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";