2

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 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();

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.

  • Are you using any other API class other than Resources? there should be at least one class other than Resources. If yes, can you try running composer update. If you cant run composer update on server, run it on localhost (development server) and then upload the resulting file to server – Arul Kumaran Sep 02 '13 at 10:33
  • @Luracast, I have run Composer on localhost and then I have uploaded to the server. I have the exact same problem. Is it possible to install Restler Explorer manually? – ilhan Jan 07 '14 at 21:08

0 Answers0