I have a PHP 5.2 application that runs under Apache, IIS and PHP-CLI.
I need to define the include path in such a way that it will be automatically loaded by PHP in each of these environments - but ONLY for this application, not for applications in other directories. The PHP 5.3 solution of custom php.ini files is not an option because we are still on PHP 5.2.
So far, I have the following solutions:
- Apache: Use SetEnv in .htaccess
- IIS: Set the value in the registry under "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PHP\Per Directory Values"
- PHP-CLI / PHPUnit: Use php -d "include_path=C:\inc1'"
Are these the best choices? Any other recommendations that would simplify this?
The one solution I do not want to do is to create a master include file that tries to figure out where it's running. The reason is that my app runs across numerous different directories, and so would need the master include file in order to find the master include file, which defeats the purpose.