duannian3494 2013-05-13 06:28
浏览 66

我想将一个服务器的php类库连接到另一个服务器

I am creating a php class library and want to place this on my own server and related the application code placed on another server. Now I what I need is to synchronize them ie the class library could be accessed by the application(s) on the other server.

How to provide a solution so that other application(s) could access my library.

  • 写回答

2条回答 默认 最新

  • douyinjiao9351 2013-05-13 06:44
    关注

    There are several ways to access this library, but you can't access it like the other local libraries or classes. The good way is to use web services.

    A good solution is to use SOAP. PHP provides good API for SOAP, which enables you to create SOAP server and client very easily.

    You will create a SOAP web server at the library end (on the server where the library is placed), and expose all the functions to the web service which you need to access. This is a very good solution and easy to use. You can find a good SOAP in PHP article here

    http://www.codewalkers.com/c/a/Miscellaneous/Using-SOAP-with-PHP/

    And also read these

    https://stackoverflow.com/questions/8657980/how-to-make-web-service-in-php

    php web service example

    and this

    http://www.vankouteren.eu/blog/2009/03/simple-php-soap-example/

    Also another way is to use xml and JSON. Please read this good article.

    http://davidwalsh.name/web-service-php-mysql-xml-json

    Please do more research and ask Mr. Google several times, and you will get a good solution according to your needs.

    Hope this will help you.

    Thank you

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用