xampp portable: xmlrpc / ripcord library - how to

Alles, was PHP betrifft, kann hier besprochen werden.

xampp portable: xmlrpc / ripcord library - how to

Postby AhmedHaroon » 06. April 2021 12:57

hi all,
first of all, I have no idea how to in PHP, below is a requirement so i have to do this ( off course this will encourage me to come in world of PHP, Laravel etc. )
we have an ubuntu 18.04 desktop VM (using vmware workstation), installed Odoo 14, here all things working fine.
on windows host machine we have portable version of xampp 7.2.34, we want to access Odoo database using ripcord library (as per official examples in their documentations), i downloaded it from github and copied in my project folder, here i created a .php file (code below) and run in chrome browser which throws error that ripcord.php file not found. secondly, i tried to install it through "composer" and tried again but still same error, also have enable xmlrpc in php.ini and it shows me when i run and check that xmlrpc is there:
Code: Select all
<?php var_dump(get_loaded_extensions()) ?>

and
Code: Select all
<?php phpinfo() ?>


my .php code to connect and access odoo database:
Code: Select all
<?php

$url = "http://192.168.18.71:8069/";
$db = 'odb14';
$username = 'myemail@mail.com';
$password = 'admin';

require_once('ripcord.php');

$common = ripcord::client($url.'/xmlrpc/2/common');
$uid = $common->authenticate($db, $username, $password, array());
$models = ripcord::client("$url/xmlrpc/2/object");
$partners = $models->execute_kw(
    $db,
    $uid,
    $password,
    'res.partner',
    'search',
    array(
        array(
            array('is_company', '=', true),
            array('customer', '=', true)
        )
    )
);
echo($uid);
echo('RESULT:<br/>');
foreach ($partners as $partner) {
    echo $partner.'<br/>';
}
?>


last error it is showing in browser:
Warning: require_once(ripcord.php): failed to open stream: No such file or directory in D:\xampp\htdocs\faaizyapi\test2.php on line 10

Fatal error: require_once(): Failed opening required 'ripcord\ripcord.php' (include_path='\xampp\php\pear\PEAR') in D:\xampp\htdocs\faaizyapi\test2.php on line 10


please help to solve the problem while keeping in mind that it is my first attempt to use PHP and if it is same in Laravel then it will be much easier/handy for me.

regards
AhmedHaroon
 
Posts: 6
Joined: 06. April 2021 12:33
XAMPP version: 7.2.34
Operating System: Windows 7

Re: xampp portable: xmlrpc / ripcord library - how to

Postby Nobbie » 06. April 2021 17:26

This the wrong forum, we do not support 3rd party modules. I have no clue about odoo, nor about ripcord. Ask odoo support instead.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: xampp portable: xmlrpc / ripcord library - how to

Postby AhmedHaroon » 07. April 2021 06:03

hi, thanks for reply. i realized that it is wrong section, it should be in PHP here in this forum. I request Admin/Moderators to move it to appropriate section below or I have to create there a new topic/thread:
https://community.apachefriends.org/f/viewforum.php?f=6

in odoo documentation (https://www.odoo.com/documentation/14.0/webservices/odoo.html) are examples for PHP (xmlrpc), i tried initial basic steps but failed to achieve anything and i knew that this is only because of my lack of knowledge regarding PHP, so plesae, anybody can help on steps including configs/setups I will be much grateful. I was searching for solution since last Sunday but unfortunately failed. asked on Odoo forum to give some examples links but don't know whey they closed my thread/topic and told me just to reference documentation which I already did.

regards
AhmedHaroon
 
Posts: 6
Joined: 06. April 2021 12:33
XAMPP version: 7.2.34
Operating System: Windows 7

Re: xampp portable: xmlrpc / ripcord library - how to

Postby Nobbie » 07. April 2021 11:40

AhmedHaroon wrote: I was searching for solution since last Sunday but unfortunately failed. asked on Odoo forum to give some examples links but don't know whey they closed my thread/topic and told me just to reference documentation which I already did.


Sorry about that, but still, this is the wrong forum (not section). We dont have any knowledge about odoo, we dont support 3d party tools here. I have no clue about odoo etc. and it is NOT a PHP issue. Its an installation issue for Odoo.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: xampp portable: xmlrpc / ripcord library - how to

Postby AhmedHaroon » 07. April 2021 11:51

dear @Nobbie, Odoo is working fine, I can access the same using python from a VM under another machine. anyway, I have posted on PHP forum here: https://www.php-forum.com/phpforum/viewtopic.php?f=1&t=29770&p=4422173
hope will get a solution.
thanks for your passions.
regards
AhmedHaroon
 
Posts: 6
Joined: 06. April 2021 12:33
XAMPP version: 7.2.34
Operating System: Windows 7


Return to PHP

Who is online

Users browsing this forum: No registered users and 14 guests