[英]How to include simple xmlrpc_client library in my simple php project
I have a simple PHP project which has xmlrpc.php
-file in php language library. 我有一个简单的PHP项目,该项目在php语言库中具有
xmlrpc.php
-file。
When I execute a file with new xmlrpc_client($this->auth_service_url);
当我使用
new xmlrpc_client($this->auth_service_url);
执行文件时new xmlrpc_client($this->auth_service_url);
it shows 表明
Class 'xmlrpc_client' not found
找不到类“ xmlrpc_client”
Can someone help me? 有人能帮我吗?
Try this new \\xmlrpc_client($this->auth_service_url); 试试这个新的\\ xmlrpc_client($ this-> auth_service_url); Or this new /xmlrpc_client($this->auth_service_url);
或这个新的/ xmlrpc_client($ this-> auth_service_url);
If you are using odoo version 8 then you just follow the below documentation 如果您使用的是odoo版本8,则只需遵循以下文档
Odoo 8 Web service API Odoo 8 Web服务API
I hope it will helpful for you. 希望对您有帮助。
It seems that xmlrpc_client is not installed in your php configuration properly or is not available in the scope you are running your command. 似乎xmlrpc_client没有正确安装在您的php配置中,或者在您运行命令的范围内不可用。 Try creating / checking your php.ini or create an info.php file and see what libraries are loaded for xmlrpc.
尝试创建/检查php.ini或创建一个info.php文件,并查看为xmlrpc加载了哪些库。 If you have this xmlrpc file in your project directory you could also make sure you are including it in your php script.
如果您的项目目录中有此xmlrpc文件,则还可以确保将其包含在php脚本中。 In my php scripts I do this.
在我的PHP脚本中,我这样做。
<?php
include "libs/odoorpc.php";
include("libs/xmlrpcs.inc");
Where odoorpc is my odoo xmlrpc class for php. 其中odoorpc是我的php的odoo xmlrpc类。 And xmlrpcs is a generic xmlrpc library available for php.
xmlrpcs是可用于php的通用xmlrpc库。 You will have to replace with the appropriate file names for your circumstance.
您必须根据情况替换为适当的文件名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.