How can PHP scripts be effectively integrated into a CMS while maintaining correct paths?

When integrating PHP scripts into a CMS, it is important to ensure that the paths to included files are correct. One way to do this is by using the `$_SERVER['DOCUMENT_ROOT']` variable to get the absolute path to the root directory of the server. This ensures that the paths remain consistent regardless of the location of the script within the CMS.

<?php
// Get the absolute path to the root directory of the server
$root_path = $_SERVER['DOCUMENT_ROOT'];

// Include a file using the absolute path
include($root_path . '/path/to/file.php');
?>