php restler explorer 404 not found ../resources.json
When attempting to run restler explorer I keep getting 404 : Not Found ../resources.json
I've gone round and round and found nothing to resolve this issue. It doesn't seem to be a permissions issue, nor a PHP version issue.
My .htaccess looks like this
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>
And if I run it with php errors on, I notice a few warnings that may or may not have to do with the issue.
Warning: realpath() expects parameter 1 to be a valid path, array given in /home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php on line 161
Warning: realpath() expects parameter 1 to be a valid path, array given in /home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php on line 161
Warning: realpath() expects parameter 1 to be a valid path, array given in /home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php on line 161
{ "error": { "code": 404, "message": "Not Found" } }
I copied the vendor/luracast/explorer/dist directory to the root of the API as instructed (public/explorer) and I created index.php in public/explorer with the following;
<?php
use LuracastRestlerRestler;
require_once '../../vendor/restler.php';
$r = new Restler();
$r->addAPIClass('LuracastRestlerResources'); //this creates resources.json at API Root
//... add more api classes if needed
$r->handle();
Not really sure how much more needs to be done, but it keeps giving me 404 : Not Found ../resources.json
My apache2 config looks like this;
<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 version: Apache/2.2.22 (Ubuntu) PHP version: PHP 5.4.9-4ubuntu2.2 (cli)
This is the first time in my life I've ever posted for help anywhere :-p .. I'm really stumped and I want to use Restler/Explorer so anyone out there that can help,,, I'd really appreciate it.
链接地址: http://www.djcxy.com/p/66086.html