require vs use (neither working) |
I am trying to include the following:
require 'vendor/Sendpulse/RestApi/ApiInterface.php"; require 'vendor/Sendpulse/RestApi/ApiClient.php'; require 'vendor/Sendpulse/RestApi/Storage/FileStorage.php'; I have tried it with "use" and also with require APPPath But I am getting this error: Severity: Compile Error Message: require(): Failed opening required 'vendor/Sendpulse/RestApi/ApiInterface.php' (include_path='.:/opt/bitnami/php/lib/php') Filename: controllers/Users_sendpulse.php Line Number: 11 What am I doing wrong?
proof that an old dog can learn new tricks
Try echoing getcwd(); immediately before the first require_once(...):, and adjust the relative path to the directory where the classes are stored.
I recommend you read PHP manual.
https://www.php.net/manual/en/language.n...orting.php It seems sendpulse/rest-api is a composer package. https://github.com/sendpulse/sendpulse-rest-api-php If you install via composer, Composer autoloader autoload the files. So you don't need to wright `require`. |
Welcome Guest, Not a member yet? Register Sign In |