Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

PHP 7 xampp #552

Closed idreesi closed 6 years ago

idreesi commented 8 years ago

I have installed restler 3.0.0 using composer on xampp PHP 7 on Windows 10, but it always give "Not Found" error even on example codes. I tried chaning htaccess and apache "AllowOverride all" but nothing works for me. Also some posts suggest to use restler RC6 I also installed that but no luck! Please suggest some solution.

tomahock commented 8 years ago

I've used restler with PHP7 without that errors. It was not on windows.. But i guess, is something in the htaccess configuration. I'm also not an apache user, but and nginx and i didn't have this kind of problem with PHP7.

grosch commented 8 years ago

Make sure you know what the "root" of your website is. That's the directory where you have to put the .htaccess file for things to work, and it needs to reference the path from there to the index.php

You also need to get rid of the second argument to the addAPIClass method. The example sends an empty string. I had to remove that to make it work.

twiddly commented 8 years ago

I'm having same issue. Can you give example of .htaccess with path from 'root' to the website?

In xampp, everything starts at htdocs (localhost). Is that where the htaccess would go?

Arul- commented 8 years ago

Yes

jeff1985 commented 7 years ago

Version 3.0.0 from composer is not php7-compatible. Make sure to use 3.0.0-RC6! your composer.json should be specified like this:

require: {
  ..
  "luracast/restler": "3.0.0-RC6"`
  ..
}
jeff1985 commented 7 years ago

meanwhile the php7-incompatibility has been solved. Can someone verify, that there is still a problem in xampp with 3.0.0?

twiddly commented 7 years ago

it doesn't work 'out of the box', and I can't figure out what htaccess I'm supposed to use and where [referencing earlier comments]

I get "Routes.php:354 at route stage" in debug along with 404 error

Arul- commented 6 years ago

That error means restler is working fine, you are calling an invalid URL. I will close this issue for now. Reopen again if you are still facing issue

websnacks commented 5 years ago

I have the same problems but after finding this solution it worked again:\ https://github.com/Luracast/Restler/issues/496#issuecomment-149174590

So if you are using XAMPP on Windows check your php.ini file and search include_path. This should start with .;