What CakePHP version are you running? How can we reproduce that error?
What code did you execute so this error appears?
I am using cake 4.0
//require_once(WWW_ROOT . ‘amazon_seller’ . DS . ‘vendor’ . DS . ‘autoload.php’);
require_once(ROOT . DS . ‘vendor’ . DS . ‘amazon_seller’ . DS . ‘vendor’ . DS . ‘autoload.php’);
use SellingPartnerApi\Api\SellersV1Api as SellersV1Api;
First of all: If you recently created a new CakePHP Project you should be on CakePHP 4.4, not CakePHP 4.0
Second: You don’t need to “re-require” the
autoload.php from your API library because CakePHP already loads the autoloader in the index.php
See app/index.php at 4.x · cakephp/app · GitHub
So every library you installed via e.g.
composer require jlevers/selling-partner-api is automatically available in your cakephp project.
So all you need for external libraries to work is to add the apropriate
use statements in your class and you should be fine.
Thanks for the suggestion it is work good in cake 4.4