简体   繁体   中英

Issues using PHP Guzzle in browser

I'm working with Guzzle for the Intercom.io API using PHP. After much wrangling I can run a few basic API calls when I write a script and run it in the terminal, but I don't have any such luck when I run that same script in my browser.

I'm sure its an easy fix I just haven't worked with this before and don't know what I'm doing

require_once 'vendor/autoload.php';

use Intercom\IntercomBasicAuthClient;


$intercom = IntercomBasicAuthClient::factory(array(
    'app_id' => 'hidden',
    'api_key' => 'hidden'
));

$a = $intercom->getUsers();
echo $a;

echo 'Hello';

In the terminal it outputs the object just fine, in the browser I don't even see "Hello".

According to Guzzle's docs , you need to have at least PHP 5.4 installed. However, from your screen of a phpinfo() your server is running PHP 5.2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM