-1

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.

user3783243
  • 5,368
  • 5
  • 22
  • 41
peter oehman
  • 13
  • 1
  • 5
  • Please post your code. – user3783243 May 03 '22 at 13:57
  • `include('stripe.inc.php')` is looking for a file in the same directory the page is running on, currently `E:/Webserver/MY_NAME/COMPANY_SITE/www/site/templates`. If the file is in another directory, the best bet is to provide the full path to the directory. – aynber May 03 '22 at 14:00
  • @user3783243 I'm not sure what code to post other than the one line include I'm using: include('stripe.inc.php'); – peter oehman May 03 '22 at 14:02
  • @aynber We would like to use the global include path as often as possible so if files get moved the include paths would not break. – peter oehman May 03 '22 at 14:03

1 Answers1

0

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"
JoelCrypto
  • 462
  • 2
  • 12