What are the potential pitfalls of using absolute paths in PHP include statements?

Using absolute paths in PHP include statements can make the code less portable and harder to maintain. If the file structure changes or the code is moved to a different server, the absolute paths may no longer work correctly. To solve this issue, it is recommended to use relative paths instead, as they are more flexible and adapt to changes in the file structure.

// Incorrect usage of absolute path
include '/var/www/html/includes/header.php';

// Correct usage of relative path
include 'includes/header.php';