2013-02-21 81 views
1

我使用XAMPP有PHP 5.3.1,与restler结构htdocs文件夹Restler 3 - 安装配置

在我的htdocs文件夹,我在index.php

<?php 
require_once 'vendor/restler.php'; 
use Luracast\Restler\Restler; 

$r = new Restler(); 
$r->addAPIClass('Say'); // repeat for more 
$r->handle(); //serve the response 

说.PHP

<?php 
class Say { 

    /* 
    * @url GET/
    */ 
    function hello($to='world') { 
     return "Hello $to!"; 
    } 

    function hi($to) { 
     return "Hi $to!"; 
    } 
} 

在浏览器中,我把

localhost/index.php/Say

localhost/index.php/Say/hello

它给了我下面的消息

Fatal error: Call to undefined function Luracast\Restler\stream_resolve_include_path() in /Applications/XAMPP/xamppfiles/htdocs/Luracast/Restler/AutoLoader.php on line 143

我在做什么错?

+0

stream_resolve_include_path仅在PHP 5.3.2上可用,但restler应该在5.3及更高版本上工作。我们会解决这个问题。同时您可以尝试升级PHP并查看它是否有效?您可以在github – Luracast 2013-02-23 00:47:23

+0

中关注[autoloader对话](https://github.com/Luracast/Restler/issues/72)。更改为支持PHP 5.4的AMPSS并正常工作 – joaodavidmateus 2013-02-23 11:55:50

回答

1

的问题是与PHP版本。从XAMPP更改为支持PHP 5.4并且现在工作的AMPSS

0

不知道是否有帮助,但你有没有试过 写小写?

localhost/index.php/say

您的代码看起来不错,我...

铜 英格

+0

尝试使用但未起作用 – joaodavidmateus 2013-02-23 11:32:39

0

Restler 3是PHP 5.3,功能stream_resolve_include_path将使用版本5.3.2和更高版本定义。