我使用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
我在做什么错?
stream_resolve_include_path仅在PHP 5.3.2上可用,但restler应该在5.3及更高版本上工作。我们会解决这个问题。同时您可以尝试升级PHP并查看它是否有效?您可以在github – Luracast 2013-02-23 00:47:23
中关注[autoloader对话](https://github.com/Luracast/Restler/issues/72)。更改为支持PHP 5.4的AMPSS并正常工作 – joaodavidmateus 2013-02-23 11:55:50