Search code examples
phpodooodoo-8xml-rpcripcord

Odoo + Ripcord PHP XMLRPC library: "Could not access https://demo.odoo.com/start"


I'm trying to make a connection from my PHP script to an Odoo server, but running into inconsistent connection problems.

I have 3 test locations:

  1. Localhost
  2. Domain A
  3. Domain B

And 2 test scripts:

Odoo Demo:

require_once("ripcord.php");
$info = ripcord::client('https://demo.odoo.com/start')->start();
print_r($info);

Odoo Target Server:

require_once("ripcord.php");
$common = ripcord::client("###.###.###.##:8069/xmlrpc/2/common");
print_r($common->version());

This gives me strange and inconsistent outcomes:

  • Localhost + Odoo Demo: success
  • Localhost + Odoo Target Server: success
  • Domain A + Odoo Demo: success
  • Domain A + Odoo Target Server: Could not access ###.###.###.##:8069
  • Domain B + Odoo Demo: Could not access https://demo.odoo.com/start
  • Domain B + Odoo Target Server: Could not access ###.###.###.##:8069

Versions:

Localhost:

  • PHP version: 7.0.15
  • Ripcord version: 0.9

Server (Domain A & Domain B):

  • PHP version: 5.6.30
  • Ripcord version: 0.9

What makes it stranger is that Domain A and Domain B are on the same server. What factors could determine whether or not the request succeeds? More importantly, how can I successfully access the Odoo Target Server from Domain A and B?


Solution

  • Turns out my problem was two-fold:

    1. Domain B seemed to have a poblem with the default RipcurlTransport (Stream); perhaps a problem with file system permissions. Switching to Curl solved the problem of not being able to connect to the Odoo demo database.
    2. The server is behind a Firewall, which needed to allow outgoing connections to port 8069. This solved the problem of not being able to connect to the production database.