What are best practices for setting the include path for PEAR.php in PHP scripts?

When using PEAR.php in PHP scripts, it is important to set the include path correctly to ensure that the script can locate the PEAR library files. One common best practice is to use the set_include_path() function to specify the path to the PEAR library directory. This function allows you to set multiple directories in the include path, separated by a colon (:) on Unix-like systems or a semicolon (;) on Windows.

// Set the include path to the directory containing PEAR.php
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/pear/library');

// Require the PEAR.php file
require_once 'PEAR.php';