I am stuck here, in wamp I run everything and work fine, however, when I tried to install api in the centos field, I always get the "Not Found" error.
I do not know what else to do!
Even the say / hello example does not work ...
Is there any specification of apache requirements for handling a restyler?
Any ideas ?, it's kind of urgent
say.php:
<?php class Say { function hello($to='world') { return "Hello $to!"; } }
index.php
<?php require_once 'restler/restler.php'; require_once 'say.php'; $r = new Restler(); $r->addAPIClass('Say'); $r->setSupportedFormats('jsonpformat', 'jsonformat', 'xmlformat', 'yamlformat'); $r->handle();
.htaccess
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 On </IfModule>
Error:
Not Found The requested URL / mylocation / say / hello was not found on this server.
Basically, all my code, if you guys think jsonpformat might go my way, I can paste this code here.
When I type url like this: http://myhost/mylocation/ I get a json error:
{ "error": { "code": 404, "message": "Not Found" } }
If I type http://myhost/mylocation/say/hello , then I get an error not found , its like .htaccess does not work.
[EDIT]
It seems to work if I add "index.php" to the url like this: http://myhost/mylocation/index.php/say/hello , but I can't leave it that way ...
I got this from: Restler returns a 404 status code if index.php is not included in the URL