How can one prevent PEAR from overwriting important files like index.php during installation?

To prevent PEAR from overwriting important files like index.php during installation, you can specify the installation path for PEAR packages. By setting a custom installation directory, you can ensure that PEAR does not overwrite any existing files in your project.

pear config-set php_dir /path/to/custom/directory