【问题标题】:Restler API framework installationRestler API 框架安装
【发布时间】:2012-08-22 14:07:43
【问题描述】:

我想开始使用 Restler 开发一个 Rest api,但是我找不到任何关于如何安装它的详细信息,此外,它似乎运行在 nginx 服务器上。

有没有办法在 apache 上运行这个框架?构建高质量 APIS 是否有其他替代方案?有没有关于安装这个框架的详细文档?

我必须能够在 apache 上运行这个框架并使用 php5.3

谢谢

【问题讨论】:

    标签: php apache api rest restler


    【解决方案1】:

    你必须启用 apache mod_rewrite

    【讨论】:

      【解决方案2】:

      我正在为 API (api.hostingxs.nl) 运行 restler(稍作修改)。它在带有 PHP 5.3 的 apache 上运行良好。只需从 github (git clone https://github.com/Luracast/Restler.git <yourdirectory>) 克隆存储库并开始包含使用它的类(阅读手册)。

      如果您需要更多指导,我可以发布一些示例代码,但如果您了解面向对象的 PHP,基本功能真的很容易。

      首先,将所有请求重定向到您的 restler 域、文件夹到 index.php 并使用以下内容创建该文件:

      require_once( "restler.php" ); # or whatever you need to link to
      $r = new Restler;
      $r -> handle();
      # above is the basic functionality without any of your own things
      

      单击以下链接中的课程以阅读有关设置自己的课程的更多信息; help.luracast.com/restler/examples/_002_minimal/readme.html

      【讨论】:

      • 谢谢你!如果不是很麻烦,如果您可以发布一些示例代码会很棒:)
      • 我一直在尝试测试 Restler 附带的示例,但我总是收到 URL not found 错误,即使对于 hello world 示例也是如此......
      【解决方案3】:

      如果您想创建一个 RESTful API,那么我为此创建了一个轻量级框架:https://github.com/martinbean/api-framework

      【讨论】:

        猜你喜欢
        • 2012-10-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-26
        • 1970-01-01
        • 2023-03-05
        • 2013-06-19
        • 2021-07-02
        相关资源
        最近更新 更多