Error HTTP_Request2 in Tesco Api php script - php

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

Related

Configure error logging - path broken

Configure error logging.
I'm working with PHP, and I'm on the support side, but I do not know the error system. Is there any material I can read to help me?
My biggest problem is this, many errors are written to the log this way:
PHP Fatal error: require_once(): Failed opening required 'vc-icon-element.php' (include_path='.;C:\php\pear') in D:\home\site\wwwroot\wp-content\plugins\js_composer\config\conte on line 6
But it seems the path is not complete and I do not know which file made the request for vc-icon-element.php. How would I do to find out which file or page that generated this log? Is it normal that the path does not reach a .php file?

require(): Failed opening required php file

Recently, I formated my whole computer, and installed Windows 7 64-bit. Before doing that I saved all of my files on an external hard drive. One of the things I backed up was a PHP script which uses AWS DynamoDB Services.
Before I formated my computer, everything went perfect. After I formated it, I installed on it XAMPP, Visual Studio Code, and PHP 7.1.1 through Microsoft WebPI.
Currently when I'm trying to run my PHP script I get this error on my screen:
Warning: require(/zip/aws/aws-autoloader.php): failed to open stream: No such file or directory in D:\Users\Lenovo\xampp\htdocs\public_html\file.php on line 7
Fatal error: require(): Failed opening required '/zip/aws/aws-autoloader.php'(include_path='D:\Users\Lenovo\xampp\php\PEAR') in D:\Users\Lenovo\xampp\public_html\file.php on line 7
I'm calling the autoloader this way:
require '/zip/aws/aws-autoloader.php';
I'm trying to understand if I forgot to install another thing, or if it's something related to the system (I had Windows 10 before)...
Could you please help me figure it out? I'm pretty new to this topic of PHP...
You should specify the entire path, like this: require __DIR__ . '/zip/aws/aws-autoloader.php';

Magento SOAP API - PHP Exception error “looks like we got no XML document”

We developed an app that pushes and retrieves data from one program to Magento via the Magento API via SOAP, using SOAP 1.1 and Magneto 1.7.0.2.
This is the kind of post we send to the magento store:
Example:
[08/Oct/2013:16:49:59 -0400] "POST /index.php/api/soap/index/ HTTP/1.0" 200 266 "-" "-"
Basically when we attempt to send these commands to the Magneto site / Server
it stops and we receive the following error:
MAGENTO::ERROR: looks like we got no XML document"
During the connection, the actual return from their magento web service is as follows:
Warning: include() [function.include]: Failed opening '/home/sistaco5/public_html/includes/src/Jemoon_Htmlminify_Model_Observer.php' for inclusion (include_path='/home/sistaco5/public_html/includes/src:.:/usr/local/php53/pear') in /home/sistaco5/public_html/includes/src/Varien_Autoload.php on line 93
This does not look like an XML.
I believe the error may be related to BOM I found at this article. Not sure if this article will work, but any other thoughts on how to address the above would be very much appreciated.
Your error points to missing files in includes/src/ which are compilation files.
Re-run compilation or disable it. Get to the Magento admin, navigate to System -> Tools -> Compilation and do a recompile or disable compilation.
If that page doesn't complete loading, do the compilation via SSH/shell:
cd /path/to/magento/root
php -f compiler.php compile to recompile OR
php -f compiler.php disable to disable/prevent magento from looking in Compilation files.
How odd is it that I'm answering to two questions that have compilation issues in 10 minutes.

Google CurlIO client requires the CURL PHP extension (Google Calendar API)

I am new to using google calendar api and I need help with this issue. I worked on a php code, let us call this cal.php, and I opened it up on my website. On my website, I get this error, Fatal error: Uncaught exception 'Exception' with message 'Google CurlIO client requires the CURL PHP extension' in my directory.
To fix this issue, I downloaded curl and in my command line, when I type 'curl', I don't get an error message. However, the problem occurs when I ssh into my website and try typing in the word curl. I get this message curl: command not found. I tried putting my curl.exe and libssh2.dll in my website directory but that didn't work out. Any help is appreciated.
I have a windows 8 and I have php but I use iis 8.
Have you checked the php.ini file - make sure there is not a semi colon before the following line.
extension=php_curl.dll

Installing PEAR in Windows Server 2008, PLESK

I'm not one to normally reach out but I've found myself completely stumped by this one.
I have a new server and chose to go with Windows Server 2008 and Plesk. After importing my site, I find that my includes no longer work, coming up with this error message:
require_once(include/online_class.php) [function.require-once]: failed to open stream: Operation not permitted
Fatal error: require_once() [function.require]: Failed opening required 'include/online_class.php
I have disabled open_basedir to make sure that it isn't conflicting but I am still getting this message. I have tried doing a fresh install of PEAR via command line and have made sure include_path points to the correct directory -> C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR
I have switched between both PHP 5.2 and 5.3 - 5.3 will just display a 500 error message without even reaching the php include errors.
Is there something I'm missing here? This is an issue I've never had with linux / cpanel builds and it's leaving a sour taste in my mouth with regards to Windows servers. What can I do to fix this problem?
Any help would be appreciated. Cheers!

Categories