'PHP global include path not working as expected

I'm trying to use a file located in C:/WEBserver/php_includes. The file in question is called stripe.inc.php, however when I include('stripe.inc.php') I get this error:

Failed opening 'E:/Webserver/MY_NAME/COMPANY_SITE/www/site/templates/stripe.inc.php' for inclusion (include_path='.;c:\WEBserver\php_includes;e:\Webserver\MY_NAME\global-lib') in E:\Webserver\MY_NAME\COMPANY_SITE\www\site\assets\cache\FileCompiler\site\templates\register-payment.php on line 868

Note that MY_NAME and MY_COMPANY are actual names, I just removed them for this question. Also note that the current file I'm in is located in a folder called templates, and php is looking for stripe.inc.php in that folder. It isn't even looking in the folder set as the global include path.



Solution 1:[1]

Maybe your include path is not configured well :

set_include_path(string $include_path);
include('stripe.inc.php');

If this works, then you should revise your php.ini file :

php_value include_path ".;C:\WEBserver\php_includes"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JoelCrypto