Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep getting 404... #12

Open
ntaloventi opened this issue Jun 17, 2016 · 10 comments
Open

keep getting 404... #12

ntaloventi opened this issue Jun 17, 2016 · 10 comments

Comments

@ntaloventi
Copy link

Dear Deerawan...
I'm new to yii...
trying to imlement your api..
got Exception (#2) on http://192.168.1.13:8080/yii2-advanced-api/api/web/
got 404 Not Found on http://192.168.1.13:8080/yii2-advanced-api/api/web/v1/countries

what I'm doing is clone your git then composer install then php ./init then ./yii migrate
if there any clue please info..

@deerawan
Copy link
Owner

Hi @ntaloventi

Have you checked the apache log? Did you use Postman?

@ntaloventi
Copy link
Author

I'm using nginx
got Exception (#2) on http://192.168.1.13:8080/yii2-advanced-api/api/web/
I have change to use with fresh install with composer...
is you have any clue what i'm doing wrong..?

@Spground
Copy link

i also got the same problem, 404 not found error! It made me confused because i done every step as the example you provided.

@Spground
Copy link

@ntaloventi @deerawan ,i think this problem occured because of escape character。In api/modules/v1/controllerspath, the CountryController has public $modelClass = api\modules\v1\models\Country;,but \v does not really mean \v, it is escape character. so, the correct form is public $modelClass = api\modules\\v1\models\Country;, which will not escape the value.

@BrainFeeder
Copy link

I got this fixed by setting enableStrictParsing to false. I am using Apache. The controller would work if you typed in the complete URL (adv-api/api/web/v1/tests) . But not when only module and controller are in the URL.
Any reason for this?

@Spground
Copy link

Spground commented Sep 1, 2016

Hi, @BrainFeeder . The reason why it did not work only module and controller are in the URL is that the application enter scriptindex.php located in adv-api/api/web, which is responsible for initializing your web application. Therefore, you must explicitly give the URLs containing the adv-api/api/web path.

@deerawan
Copy link
Owner

deerawan commented Sep 1, 2016

@ntaloventi I haven't tried it in nginx, there must be extra configuration different with apache.
@Spground interesting, so after you added extra slash to \v1, did it work?
@BrainFeeder I will check my apache setting again.

@Spground
Copy link

Spground commented Sep 1, 2016

@deerawan yes. it worked for me after I added extra backlash to v1.

@gvanto
Copy link

gvanto commented Dec 13, 2016

I have an issue with class not being found: http://stackoverflow.com/questions/41096504/yii2-module-not-under-vendor-folder-class-not-found-in-config-main-php

I've downloaded this repository (yii2-advanced-api) and used the api folder ...

@McNamara10
Copy link

i have thi erro error 404, its'solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants