I am getting this error:
Fatal error: Class 'http\Client' not found in /var/www/html/scripts/collections_getter_controller.php on line 46
The problem is the script "collections_getter_controler" is an include from two different scripts. When I exec the first one no error is prompted; however, when I exec the second one the error appears.
First script:
<?php
require "predis/autoload.php";
include "collections_getter_controller.php";
include "metadata_getter_controller.php";
include "bits_getter_controller.php";
include "invertedIndex.php";
Predis\Autoloader::register();
try {
$redis = new Predis\Client();
.
.
.
The second script:
<?php
include "collections_getter_controller.php";
include "bits_getter_controller.php";
$itemIds = getCollectionitemIds('6');
.
.
.
As you can see in both cases the first include is "collections_getter_controller", so I can not identify what can be the problem because it's loaded in the first script but not the second.
Also, I should mention, I'm working on a Docker Image which is
FROM php:5.6.34-apache-jessie
EDIT
Following ceejayoz comment I'm adding the part of "collections_getter_controler" in which http\Client is used
<?php
$xml = simplexml_load_file('../scripts/getter_config.xml');
# Here goes more code not related to the question
function getJSONCollections($id_req, $i){
set_time_limit(0);
$client = new http\Client;
$request = new http\Client\Request;
switch ($i) {
case '1':
$request->setRequestUrl((string)$GLOBALS['xml']->request->request_url.'/collections/'.$id_req);
break;
case '2':
$request->setRequestUrl((string)$GLOBALS['xml']->request->request_url.'/collections/'.$id_req.'/items');
break;
default:
$request->setRequestUrl((string)$GLOBALS['xml']->request->request_url.'/collections/'.$id_req);
break;
}
$request->setRequestMethod((string)$GLOBALS['xml']->request->request_method);
$request->setHeaders(array(
'postman-token' => (string)$GLOBALS['xml']->request->header_token,
'cache-control' => (string)$GLOBALS['xml']->request->header_cache,
'authorization' => (string)$GLOBALS['xml']->request->header_auth
));
$client->enqueue($request)->send();
$response = $client->getResponse();
return $response->getBody();