PEAR error trying to connect to gandi using test code
[email protected] ("brads") Thu, 9 Apr 2015 02:31:38 -0400
| Newsgroups | php.pear.general |
|---|---|
| Message-ID | <[email protected]> |
My first connection attempt to the gandi api and my script blows up with a
mis guided PEAR issue:
# php ganditest.php
PHP Warning: require_once(XML/RPC2/Exception.php): failed to open
stream: No such file or directory in
/usr/local/share/pear/XML/RPC2/Client.php on line 43
Warning: require_once(XML/RPC2/Exception.php): failed to open stream: No
such file or directory in /usr/local/share/pear/XML/RPC2/Client.php on line
43
PHP Fatal error: require_once(): Failed opening required
'XML/RPC2/Exception.php' (include_path='.:/usr/local/bin/') in
/usr/local/share/pear/XML/RPC2/Client.php on line 43
Fatal error: require_once(): Failed opening required
'XML/RPC2/Exception.php' (include_path='.:/usr/local/bin/') in
/usr/local/share/pear/XML/RPC2/Client.php on line 43
I try to set it to the PEAR dir:
# pear config-set bin_dir /usr/local/share/pear
config-set succeeded
and
# php ganditest.php
PHP Warning: require_once(XML/RPC2/Exception.php): failed to open
stream: No such file or directory in
/usr/local/share/pear/XML/RPC2/Client.php on line 43
Warning: require_once(XML/RPC2/Exception.php): failed to open stream: No
such file or directory in /usr/local/share/pear/XML/RPC2/Client.php on line
43
PHP Fatal error: require_once(): Failed opening required
'XML/RPC2/Exception.php' (include_path='.:/usr/local/bin/') in
/usr/local/share/pear/XML/RPC2/Client.php on line 43
Fatal error: require_once(): Failed opening required
'XML/RPC2/Exception.php' (include_path='.:/usr/local/bin/') in
/usr/local/share/pear/XML/RPC2/Client.php on line 43
# cat ganditest.php
<?php
require_once '/usr/local/share/pear/XML/RPC2/Client.php';
$version_api = XML_RPC2_Client::create(
'https://rpc.gandi.net/xmlrpc/',
array( 'prefix' => 'version.', 'sslverify' => True )
);
$apikey = 'mykey';
$result = $version_api->info($apikey);
print_r($result);
?>
How do I tell PhP to look for PEAR in the correct folder so I can connect to
Gandi?