How can one ensure that PHP scripts with sensitive information are not exposed in the event of server misconfiguration?
To ensure that PHP scripts with sensitive information are not exposed in the event of server misconfiguration, one can store sensitive information in a separate configuration file outside of the web root directory. This way, even if the server is misconfigured and allows direct access to PHP files, the sensitive information will not be exposed.
```php
// config.php file outside of web root directory
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'username');
define('DB_PASS', 'password');
define('DB_NAME', 'database');
?>
```
In this example, the sensitive database connection information is stored in a separate config.php file outside of the web root directory. This file can be included in PHP scripts that need access to the sensitive information without exposing it to potential attackers.