What are the security considerations when running PHP scripts locally with XAMPP and how can they be addressed?

One security consideration when running PHP scripts locally with XAMPP is to avoid exposing sensitive information, such as database credentials, in your code. This can be addressed by storing sensitive information in a separate configuration file outside of the web root directory and including it in your PHP scripts securely.

// config.php
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', 'password');
define('DB_NAME', 'database_name');
?>

// index.php
<?php
require_once('config.php');

// Use the defined constants to connect to the database
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
?>