Im using the ci-merchant library in my PyroCMS module locally on my development WAMP server. (all working fine)
When I upload to my Linux test server the purchase()
function being called does not seem to work.
When it executes it pools for 5 minutes then I get a response "Could not connect to host".
PHP
$params =
array(
'amount' => 20,
'currency' => 'USD',
'return_url' => 'http://someurl.com/return/'
'cancel_url' => 'http://someurl.com/cancel/'
);
$settings = array(
'test_mode' => TRUE,
'username' => 'PAYPAL_TEST_USERNAME'
'password' => 'MY_PAPAL_TEST_PASS'
'signature' => 'MY_PAYPAL_TEST_SIG'
);
$this->load->library('merchant');
$this->merchant->load('paypal_express');
$this->merchant->initialize($settings);
//this is where Im having the issue
$response = $this->merchant->purchase($params);
$message = $response->message();
When I echo $message
echo $message; //Outputs: couldn't connect to host"
CURL - Server Settings
Below is a list of the differences in the CURL settings on the servers. Perhaps this is the issue. I dont think these settings can be changed without having to compile curl but im not sure.
Development Server (WAMP server - status:Working)
AsynchDNS : Yes
CurlInfo : 7.21.7
GSS Neg : Yes
IDN : No
SSPI : Yes
libSSH : libssh2/1.2.7
Test Server (Linuxserver - status:Not working)
AsynchDNS : No
CurlInfo : 7.24.0
GSS Neg : No
IDN : Yes
SSPI : No
libSSH : <<not listed>>
After much trial and error and some advice from friends I found this to be a missing libSSH module.
Since then I have moved my site from a shared hosting company to a more reliable VPS Hosting.
I installed the appropriate libraries and everything is working fine.
I would recommend anyone hosting their sites to moving away from any "shared" hosting companies. I only encountered very delayed support and VPS Hosting wasnt really that much more than what I was paying for VPS.
But you will need to know how to manage a server before you do.