Domanda

I have API http://api.odtu.lu/v1/index.php/users/3 and the explorer http://api.odtu.lu/explorer/ and my index.php file is as follows

require_once '../vendor/restler.php';
ORM::configure('mysql:host=localhost;dbname=thedatabasename');
ORM::configure('username', 'ilhan');
ORM::configure('password', 'password123');
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
use Luracast\Restler\Restler;
$r = new Restler();
$r->addAPIClass('Luracast\\Restler\\Resources');
$r->addAPIClass('Users');
$r->handle();

However I get the error message shown here http://api.odtu.lu/explorer/

Note that I don't have any administrative rights on the shared hosting, like editing Apache configuration files and SSH. And my PHP version is http://api.odtu.lu/phpinfo.php

There is a similar issue but resolves it by httpd.conf file Can't find resources.json I don't have permissions to edit that file.

I have no idea where to find this resources.json file.

È stato utile?

Soluzione

I had the same problem, and i solved by adding this line to my index.php:

$restler->addApiClass('Resources'); //this produces the needed resources.json

You can find more info here: Restler always returns 404: Not found

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top