How can one troubleshoot and debug PHP scripts that involve file inclusion and variable scope issues?

To troubleshoot and debug PHP scripts that involve file inclusion and variable scope issues, you can start by checking if the included files are being correctly included and if the variables are properly scoped. Make sure to use functions like include_once() or require_once() to avoid including the same file multiple times. Additionally, use global keyword to access variables defined outside the current scope.

<?php
// File: index.php
$globalVariable = "Hello";

function includeFile() {
    global $globalVariable;
    include_once('includedFile.php');
    echo $localVariable;
}

includeFile();
?>
```

```php
<?php
// File: includedFile.php
$localVariable = "World";
?>