Closed MasterGHD closed 3 years ago
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. Enable Internet Information Services and expand it. There is an option called CGI that is used also for PHP.
The quickest way to add PHP 8 is installing it manually, and then add via PHP Manager.
Try to set the prefix
property manually in the SubFolder middleware to /projects/yii3basic
@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 /projects/yii3basic/assets
.
Try change https://github.com/yiisoft/app/blob/master/config/params.php#L22 to
/projects/yii3basic/assets
.
i think this value should be prefixed with @baseUrl
: '@baseUrl/assets'
The @baseUrl
alias will be changed automatically in the SubFolder middleware
Try change https://github.com/yiisoft/app/blob/master/config/params.php#L22 to
/projects/yii3basic/assets
.
@rustamwin @roxblnfk yes, this solved the assets issue.
Try change https://github.com/yiisoft/app/blob/master/config/params.php#L22 to
/projects/yii3basic/assets
.i think this value should be prefixed with
@baseUrl
:'@baseUrl/assets'
The
@baseUrl
alisa will be changed automatically in the SubFolder middleware
@samdark is there a good reason the SubFolder middleware is not included in the web/application config by default?
@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. But it's strange that it is not included in the yiisoft/demo project.
For main template it's OK.
To beginners in Yii3 (like myself), it's one more step to configure after a fresh install.
But it's strange that it is not included in the yiisoft/demo project.
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.
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.
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.
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