m_cheah
m_cheah

Reputation: 131

Error HTTP_Request2 in Tesco Api php script

Note: Beginner to php and programming on web databases.

I am trying to implement the Tesco API on the 000webhost webhosting site. I've copied the PHP script at the Tesco labs page, put it in the database at 000webhost where I call it with the index.php script, however when I tried to implement the code, it gives me this error:

Warning: require_once(HTTP/Request2.php): failed to open stream: No such file or directory in /storage/ssd4/772/1967772/public_html/tesco_api.php on line 3

Fatal error: require_once(): Failed opening required 'HTTP/Request2.php' (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd4/772/1967772/public_html/tesco_api.php on line 3

From the error message, the culprit is this line in the Tescolab API script:

require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://dev.tescolabs.com/product/');

Which seems to give an error because of some missing pear installation (don't really understand this)

It seems impossible to install this pear thing on 000webhost, and I've tried searching for workarounds for the HTTP_Request2, such as by using curl, but I can't seem to find a working solution. I also couldn't understand what the comment in the Tesco API meant:

// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)

If someone could propose a solution to this issue, either with a curl workaround, or by managing to install the pear thing

Upvotes: 0

Views: 146

Answers (0)

Related Questions