-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Running yii3 on subfolder with IIS 10 #141
Comments
This becomes difficult to troubleshoot and isn't necessarily a Yii2 issue IMHO. https://news-web.php.net/php.internals/110907 I ran into some issues configuring an IIS handler. Admittedly, I am not a IIS expert or even novice. |
@cgsmith the app runs smoothly with Yii 2.0 and 1.1 on IIS. This repo is about the new version: Yii 3.0. |
For the install, I used Web Platform Installer from Microsoft, PHP Manager from phpmanager.xyz and Fast CGI. To enable IIS and Fast CGI, it is necessary to go to Programs and Features (Control Panel) > Turn Windows features on or off. The quickest way to add PHP 8 is installing it manually, and then add via PHP Manager. |
Try to set the |
@roxblnfk I don't know how to implement it. Can you give an example? |
@samdark it's almost there. How do I adjust the base URL used on CSS and JS files by assets? |
Try change https://github.com/yiisoft/app/blob/master/config/params.php#L22 to |
i think this value should be prefixed with The |
@rustamwin @roxblnfk yes, this solved the assets issue.
@samdark is there a good reason the SubFolder middleware is not included in the web/application config by default? |
For main template it's OK. |
To beginners in Yii3 (like myself), it's one more step to configure after a fresh install.
I agree. |
Well, nowadays it's often Docker images and these are always point to the webroot. There's no sub-directoryies. That's why it wasn't done by default. |
I still can't use Docker. For some reason, my Windows shows a BSOD if I try to install Docker or by enabling Hyper-V. |
I see. At least we need it documented well. |
@samdark it will help a lot. Shall we close this issue and open a new one, related to mine? Or keep it opened? |
Keep it opened. Open another one. |
Ok. Thank you. |
Closing since it's in the default config now. |
What steps will reproduce the problem?
Assuming that you're using PHP 8.x with IIS 10.0:
Run composer on command prompt (admin)
Run "cd c:\inetput\wwwroot\projects" (this is my main folder)
Run "composer create-project --prefer-dist --stability=dev yiisoft/app basic"
On IIS, expand the Default Web Site -> projects and right click on this folder "Add virtual directory"
On the alias, type "yii3basic" and folder "C:\inetpub\wwwroot\projects\basic\public".
In IIS, click once on "yii3basic" folder, and select PHP Manager. Make sure it's selected PHP 8.x, and the extensions "fileinfo" and "pdo sqlite" are enabled
Open the browser and navigate to http://localhost/projects/yii3basic
If the framework shows any warning about runtime folder, make sure the folders have sufficient permissions
What is the expected result?
Navigate to the landing page (index)
What do you get instead?
A 404 error: The page /projects/yii3basic/ not found.
Additional info
The text was updated successfully, but these errors were encountered: