Search code examples
restler

Restler not loading any classes


Using Restler 3.0.0-RC6 I'm getting a 404 from Routes.php at route stage. I've turned on rewrite debugging on apache and I see that it's redirecting to /var/www/html/api/public/index.php when I try to load the URL, and that is in fact where the index.php for Restler lives. It's just not loading any of the classes from the src directory though. How do I debug this?

Here's the rewrite rule output:

[perdir /var/www/html/api/] add path info postfix: /var/www/html/api/v2 -> /var/www/html/api/v2/team/details/1/0
[perdir /var/www/html/api/] strip per-dir prefix: /var/www/html/api/v2/team/details/1/0 -> v2/team/details/1/0
[perdir /var/www/html/api/] applying pattern '^$' to uri 'v2/team/details/1/0'
[perdir /var/www/html/api/] add path info postfix: /var/www/html/api/v2 -> /var/www/html/api/v2/team/details/1/0
[perdir /var/www/html/api/] strip per-dir prefix: /var/www/html/api/v2/team/details/1/0 -> v2/team/details/1/0
[perdir /var/www/html/api/] applying pattern '^(.*)$' to uri 'v2/team/details/1/0'
[perdir /var/www/html/api/] RewriteCond: input='/var/www/html/api/v2' pattern='!-f' => matched
[perdir /var/www/html/api/] RewriteCond: input='/var/www/html/api/v2' pattern='!-d' => matched
[perdir /var/www/html/api/] rewrite 'v2/team/details/1/0' -> 'public/index.php'
[perdir /var/www/html/api/] add per-dir prefix: public/index.php -> /var/www/html/api/public/index.php
[perdir /var/www/html/api/] strip document_root prefix: /var/www/html/api/public/index.php -> /api/public/index.php
[perdir /var/www/html/api/] internal redirect with /api/public/index.php [INTERNAL REDIRECT]
[perdir /var/www/html/api/public/] strip per-dir prefix: /var/www/html/api/public/index.php -> index.php
[perdir /var/www/html/api/public/] applying pattern '^' to uri 'index.php'
[perdir /var/www/html/api/public/] RewriteCond: input='/var/www/html/api/public/index.php' pattern='!-d' => matched
[perdir /var/www/html/api/public/] RewriteCond: input='/var/www/html/api/public/index.php' pattern='!-f' => not-matched
[perdir /var/www/html/api/public/] pass through /var/www/html/api/public/index.php

And as you can see, the index.php is there, and the appropriate class is there:

% ls -l /var/www/html/api/public/index.php
-rw-r--r-- 1 root root 961 Jun 3 21:40 /var/www/html/api/public/index.php
% ls -l /var/www/html/api/src/v2/Team.php
-rw-rwxr-- 1 559 559 19255 May 9 23:02 /var/www/html/api/src/v2/Team.php


Solution

  • I forgot to include the Defaults::$useUrlBasedVersioning = true; line in my index.php so it was always trying to force a v1 version to load, which doesn't exist any longer.