php restler explorer 404找不到../resources.json

时间:2013-08-31 20:17:23

标签: php json .htaccess explorer restler

尝试运行restler资源管理器时,我一直在努力 404:Not Found ../ resources.json

我已经四处走动,没有找到解决这个问题的方法。它似乎不是权限问题,也不是PHP版本问题。

我的.htaccess看起来像这样

Options -MultiViews
DirectoryIndex index.php
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^$ index.php [QSA,L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule mod_php5.c>
        php_flag display_errors Off
</IfModule>

如果我在启用php错误的情况下运行它,我会注意到一些可能与此问题有关的警告。

警告:realpath()要求参数1为有效路径,在 /home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler中给出的数组/AutoLoader.php 在行 161
警告:realpath()期望参数1成为有效路径,在给定的数组中 /home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php 161 b>警告:realpath()期望参数1是一个有效的路径,在 /home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php中给出的数组在线 161
{{error“:{”code“:404,”message“:”Not Found“}}

我按照指示(public / explorer)将vendor / luracast / explorer / dist目录复制到API的根目录,并使用以下内容在public / explorer中创建了index.php;

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

$r = new Restler();
$r->addAPIClass('Luracast\\Restler\\Resources'); //this creates resources.json at API Root
//... add more api classes if needed
$r->handle();

不确定还需要做多少,但它一直给我404:Not Found ../ resources.json

我的apache2配置看起来像这样;

<VirtualHost *:80>
        ServerAdmin root
        ServerName ucemi.com

        DocumentRoot /home/sonic/Public/html/ucemi/ucemi.com/public
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /home/sonic/Public/html/ucemi/ucemi.com/public>
                AllowOverride All
                Options FollowSymlinks
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Apache版本:Apache / 2.2.22(Ubuntu) PHP版本:PHP 5.4.9-4ubuntu2.2(cli)

这是我生命中第一次在任何地方寻求帮助:-p ..我真的很难过,我想使用Restler / Explorer,所以任何人都可以帮助,,,我真的很感激。

0 个答案:

没有答案
相关问题