我正在尝试创建一个类文件,其中包含调用Amazon Product API,Report API,Feeds API的所有方法。 所以我必须包括所有必需的文件。我在这个类文件的相同路径上获得了所有Amazon API Class文件夹,我包括以下方式:
=============================================== =========
//对于getASIN
require_once 'AmazonProductsAPI/src/MarketplaceWebServiceProducts/Client.php';
require_once 'AmazonProductsAPI/src/MarketplaceWebServiceProducts/Model/GetCompetitivePricingForSKURequest.php';
require_once 'AmazonProductsAPI/src/MarketplaceWebServiceProducts/Model/SellerSKUListType.php';
//For putPrice (Price Change)
require_once 'FeedsAPIClass/src/MarketplaceWebService/Client.php';
require_once 'FeedsAPIClass/src/MarketplaceWebService/Mock.php';
require_once 'FeedsAPIClass/src/MarketplaceWebService/Model/SubmitFeedRequest.php';
//For Updating Quantity and Price From Amazon Report API to Our DB
require_once 'ReportsAPIClass/src/MarketplaceWebService/Client.php';
require_once 'ReportsAPIClass/src/MarketplaceWebService/Model/RequestReportRequest.php';
require_once 'ReportsAPIClass/src/MarketplaceWebService/Model/GetReportListRequest.php';
require_once 'ReportsAPIClass/src/MarketplaceWebService/Model/GetReportRequest.php';
======================================================
But i am getting error like:
======================================================
enter code here
PHP Warning: require_once(MarketplaceWebServiceProducts/Interface.php): failed to open stream: No such file or directory in /mnt/hgfs/keyur On My Mac/webs/keyur.iec.com/htdocs/vendors/AmazonAPI/AmazonProductsAPI/src/MarketplaceWebServiceProducts/Client.php on line 22
Warning: require_once(MarketplaceWebServiceProducts/Interface.php): failed to open stream: No such file or directory in /mnt/hgfs/keyur On My Mac/webs/keyur.iec.com/htdocs/vendors/AmazonAPI/AmazonProductsAPI/src/MarketplaceWebServiceProducts/Client.php on line 22
PHP Fatal error: require_once(): Failed opening required 'MarketplaceWebServiceProducts/Interface.php' (include_path='.:/usr/share/pear:/usr/share/php:/mnt/hgfs/keyur\ On\ My\ Mac/webs/keyur.iec.com/htdocs/vendors/AmazonAPI/AmazonProductsAPI/src') in /mnt/hgfs/keyur On My Mac/webs/keyur.iec.com/htdocs/vendors/AmazonAPI/AmazonProductsAPI/src/MarketplaceWebServiceProducts/Client.php on line 22
Fatal error: require_once(): Failed opening required 'MarketplaceWebServiceProducts/Interface.php' (include_path='.:/usr/share/pear:/usr/share/php:/mnt/hgfs/keyur\ On\ My\ Mac/webs/keyur.iec.com/htdocs/vendors/AmazonAPI/AmazonProductsAPI/src') in /mnt/hgfs/keyur On My Mac/webs/keyur.iec.com/htdocs/vendors/AmazonAPI/AmazonProductsAPI/src/MarketplaceWebServiceProducts/Client.php on line 22
=============================================== =====
根据我的电脑,这条路径是正确的,但不知道出了什么问题。 请帮助.........................
答案 0 :(得分:1)
.config.inc.php可以帮到你:
/***
* OPTIONAL ON SOME INSTALLATIONS
*
* Set include path to root of library, relative to Samples directory.
* Only needed when running library from local directory.
* If library is installed in PHP include path, this is not needed
*/
set_include_path(get_include_path() . PATH_SEPARATOR . '../../.');