What are the consequences of using absolute paths versus relative paths in PHP code?

Using absolute paths in PHP code can make the code less portable and more prone to errors when moving it to a different server or directory. Relative paths are preferred as they are more flexible and can adapt to different environments. To solve this issue, it is recommended to use relative paths whenever possible in PHP code.

// Absolute path example
include '/var/www/html/includes/config.php';

// Relative path example
include 'includes/config.php';