What potential issues can arise when using relative paths in PHP scripts?

When using relative paths in PHP scripts, potential issues can arise if the current working directory is not what is expected, leading to errors in file inclusion or manipulation. To avoid this, it's best to use absolute paths or ensure that the working directory is properly set before using relative paths.

// Set the current working directory to the directory of the script
chdir(dirname(__FILE__));

// Now you can safely use relative paths
include 'file.php';