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

500 Internal Server Error & missing folders #123

Open
SteppeWest opened this issue Jan 24, 2015 · 5 comments
Open

500 Internal Server Error & missing folders #123

SteppeWest opened this issue Jan 24, 2015 · 5 comments

Comments

@SteppeWest
Copy link

After setting up my yii2-start application I get a "500 Internal Server Error" on both front end & back end.
Looking through the folder structure I find that as compared to the standard yii2-advanced application the following folders are missing...

  • backend/assets
  • backend/controllers
  • backend/models
  • backend/views
  • common/mail
  • common/models
  • console/controllers
  • console/models
  • frontend/assets
  • frontend/controllers
  • frontend/models
  • frontend/views
  • frontend/widgets

So it appears that I have an application with no models, controlers, or views.

All my other yii2 applications work as expected.

@vova07
Copy link
Owner

vova07 commented Jan 24, 2015

In yii2-start this folders are missing because all needed class for work, are in separate modules, in vendor path.
Can you give a screen or a log of 500 error?

@SteppeWest
Copy link
Author

Here's a sample of the log...

[Sun Jan 25 01:20:47.246839 2015] [core:alert] [pid 397] [client 127.0.0.1:51213]
/WWW/yii.y2start/.htaccess: <IfModule not allowed here, referer: http://portal.dev/web/
[Sun Jan 25 01:24:59.569564 2015] [core:alert] [pid 45225] [client 127.0.0.1:51219]
/WWW/yii.y2start/.htaccess: <IfModule not allowed here, referer: http://portal.dev/web/
[Sun Jan 25 01:25:04.397372 2015] [core:alert] [pid 397] [client 127.0.0.1:51224]
/WWW/yii.y2start/.htaccess: <IfModule not allowed here, referer: http://portal.dev/web/
[Sun Jan 25 01:25:27.697763 2015] [core:alert] [pid 45225] [client 127.0.0.1:51226]
/WWW/yii.y2start/.htaccess: <IfModule not allowed here, referer: http://portal.dev/web/

Disabling the .htaccess referenced there resolved the problem but I wonder what problems I may have introduced.

Having done that the front end loads as expected but the back end is completely unstyled. Looking into the rendered code I find that assets are referenced as being at /backend/assets rather than just /assets. As a temporary workaround I created a folder matching that & copied the assets to it. The back end now renders correctly but that workaround isn't viable in the long run.

I must offer the opinion that having controllers, modules, & views in the standard locations is better because it makes tracking issues like these, and also further customisation, much easier. I also think it better to copy assets to web/assets rather than symlinking them because many shared hosting services don't permit symlinks.

@vova07
Copy link
Owner

vova07 commented Jan 25, 2015

It's seems that you need to configure your apache, to enable configuration from the .htaccess file.
So ensure that you have the option AllowOverride All in your directory section.

From README:

<VirtualHost *:80>
    ServerName www.yii2-start.domain # You need to change it to your own domain  
    ServerAlias yii2-start.domain # You need to change it to your own domain  
    DocumentRoot /my/path/to/yii2-start # You need to change it to your own path  
    <Directory /my/path/to/yii2-start> # You need to change it to your own path  
        AllowOverride All  # I was mean exactly this line
    </Directory>  
</VirtualHost>

What about controllers, modules, and views in the standard locations: In my application you don't have restriction, and you are free to use whatever internal structure you want. The main reason of separate modules, is to give you a really clean template, that will have just really needed things with minimal addons. So after installation each of us, can choose his preferable way to develop his application, without needed to clean up some extra directory.

About symlink: In case when it's not supported you can really easy disabled it by config file, just making linkAssets => false.

@rajesh188
Copy link

dear vova07, do i have to create virtual host?
please iam having trouble getting this started

i am on windows 8 with wamp server i did all mentioned in readme.
i did not configure virtual hosts.
im having 403 forbidden errors when accessing localhost/yii2-start pls guide me through installation.

@vova07
Copy link
Owner

vova07 commented Feb 11, 2015

Hi @rajesh188 ,
I'm not sure about wamp but i guess you'll need to create a VH, or at least to allow override his config from .htaccess. I think you get 403 error right because you don't have AllowOverride All in your wamp config.
If you have a problems with VH please take a look on this tutorial or just google something else for wamp virtual host configuration.
Let me know if you'll have other questions.

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

3 participants