Welcome Guest, Not a member yet? Register   Sign In
require vs use (neither working)
#1

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
Reply
#2

Try echoing getcwd(); immediately before the first require_once(...):, and adjust the relative path to the directory where the classes are stored.
Reply
#3

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`.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB