What are the potential pitfalls of using absolute paths in PHP scripts, especially when transferring to different servers?

Using absolute paths in PHP scripts can cause issues when transferring to different servers because the absolute path may not be the same on the new server. To avoid this problem, it's recommended to use relative paths instead of absolute paths in your PHP scripts.

// Incorrect usage of absolute path
include('/var/www/html/includes/config.php');

// Correct usage of relative path
include('includes/config.php');