What are common issues with path handling in PHP when changing servers?

When changing servers in PHP, common issues with path handling may arise due to differences in server configurations or directory structures. To solve this, use the `$_SERVER['DOCUMENT_ROOT']` superglobal variable to get the root directory of the server and construct paths relative to it.

// Get the root directory of the server
$root = $_SERVER['DOCUMENT_ROOT'];

// Define a path relative to the root directory
$path = $root . '/path/to/file';