您现在的位置是:主页 > news > 没有服务器怎么做网站/安装百度到手机桌面
没有服务器怎么做网站/安装百度到手机桌面
admin2025/5/21 17:38:11【news】
简介没有服务器怎么做网站,安装百度到手机桌面,网站建设后的优势,建设公司网站的好处我在本地服务器上安装了Restler来测试并为我的项目制作一些API.Api请求通过http:// localhost / myproject / api /处理.问题是每次我尝试发出请求时都会收到以下错误:{"error": {"code": 404,"message": "Not Found…
我在本地服务器上安装了Restler来测试并为我的项目制作一些API.
Api请求通过http:// localhost / myproject / api /处理.
问题是每次我尝试发出请求时都会收到以下错误:
{
"error": {
"code": 404,
"message": "Not Found"
},
"debug": {
"source": "Routes.php:383 at route stage",
"stages": {
"success": [
"get"
],
"failure": [
"route",
"negotiate",
"message"
]
}
}
}
这也是我的.htaccess:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api(.*)$/myproject/api/api.php [QSA,L]
这就是api.php的样子:
namespace myproject;
use Luracast\Restler\Restler;
require_once($_SERVER["DOCUMENT_ROOT"]."/myproject/resources/engine/settings.php");
require_once(Settings\Path\Absolute::$library."/restler/vendor/restler.php");
$restler = new Restler();
$restler->addAPIClass("myproject\\User");
$restler->handle();
我猜周围有一些误配,但我真的无法弄清楚出了什么问题.
(我也在Stackoverflow上尝试了一些解决方案,但它们似乎对我不起作用)
编辑:
我尝试使用以下路径http:// localhost / myproject / resources / engine / library / restler / public / examples来实现示例,并且它们正在工作,所以我想它与Restler本身的配置有关,因为它没有似乎在http:// localhost / myproject / api中工作.
此外我还尝试在http:// localhost / myproject / api / explorer中复制Restler Explorer并且我一直收到错误:404:Not Found ../resources.json可能是因为我没有在根文件夹中安装Restler我的项目.我怎么能在不同的子文件夹中安装Restler?
编辑2:
我刚刚将以下类移到示例001文件夹中:
class User {
function data() {
return "HELLO!";
}
}
并在示例的index.php中添加了这一行:
$r->addAPIClass('User');
如果我试图在… / _ 001_helloworld / index.php / say / hello运行示例它没有问题,但如果我尝试_001_helloworld / index.php / user / data则不行.
在这一点上,我已经失去了所有的希望,我真的需要帮助’因为我真的错过了什么,但实在无法猜到:(帮助!