-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Magento 2.4.2 old docroot logic does not work without workaround #32285
Comments
Hi @AstroniumGIT. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
I've had a similar experience as AstroniumGIT - fresh install in a subdirectory and changed the I can't find any documentation around this change (granted this is a tricky one to search for) or what needs to be done to ensure installation works in a subdirectory now. |
Thank you for reporting this. The change was done as part of the Remote Storage development track. We have not found official mention of this installation flow in either public or internal documentation. Also, our manual tests showed it as partially broken in 2.4.1. |
This .htaccess rule works for me (remove the slash before pub/):
|
the new installation documentation simply puts "pub set as the document root" in the requirements, which simply washes its hands of all other scenarios. |
You still can use We've adjusted root So, in version 2.4.2+ you still have 3 options as before:
Since having Magento in subdirectories is not officially supported and tested, I would encourage you to use a workaround and create a pull-request into DevDocs with the preferred method. Otherwise, we do not have any tests or tools in place to verify this installation method. |
I understand that having magento in subdirectories is not supported since 2.2 or somewhere in 2.3 - it would have been nice if so many installation instructions and hosting companies didn't still make it a default. but here's what the current installation instructions say in https://devdocs.magento.com/guides/v2.4/install-gde/composer.html - this will not produce a functioning site in 2.4.2
I've wasted a few test installs so far trying to get a 2.4.2 instance - installed with the new desired root and route through pub setup - that works with a base url of http://mysite.com/shop |
Maybe this link https://devdocs.magento.com/guides/v2.4/install-gde/tutorials/change-docroot-to-pub.html will have more clear about this |
@iphigenie is this solved for you with alternative configuration instructions? I will be happy to help with any documentation updates if needed. |
CC: @dobooth may be we need add issue clarify this section in devdocs |
Thanks for the great conversation here. I would be happy to help with any PR around this. Is this a matter of removing the |
We've performed an investigation and found the solution with symlinks (https://magento.stackexchange.com/a/332419/38801) to be working fine on 2.4.2. We will proceed with official documentation for it. Please let me know if there any other use cases that need investigation. |
DevDocs was updated with https://devdocs.magento.com/guides/v2.4/release-notes/open-source-2-4-2.html#known-issues |
@shiftedreality: please link to publicly visible repositories, the link you put here is a private repository, thanks! 🙂 |
@hostep thanks for noticing this, changed to link on DevDocs instead of private PR |
Hi @shiftedreality Is there any link available in devdocs for guide setup multiple domain/stores with 2.4.2 root pub changes |
Thank you all for colaboration! |
@shiftedreality I got rid of the subfolders but I can't help but notice that the installation instructions https://devdocs.magento.com/guides/v2.4/install-gde/composer.html are STILL GIVING EXAMPLES THAT LEAD TO GENERAL 404 These need to be modified to something that works on 2.4.2 Because people are following these instructions and you can find them on stack exchange "fresh install doesnt work" https://magento.stackexchange.com/questions/337808/magento-2-fresh-install-showing-whoops-our-bad-404-page-not-found/339249 |
Hello!
On the other day i had a task to install magento 2.4.2 for testing purposes. I am holding my testing shops in subdirectories.
Version 2.4.2 does not work with that logic from the start because it's following new pub docroot path.
Magento is working perfectly fine if I will create a virtual host that points on pub directory. But on some testing servers i would preffer to hold different magento installations in subdirectories rather than creating a subdomains. So I tried to find the way for it to work with old logic and in my opinion I found some bugs that broke the old way of accesing magento which results into the need of implementing a workaround to work properly.
Preconditions
Steps to reproduce
Okay, that 404 error is expected because the request is redirected to 127.0.0.1/pub and I don't have it on my environment. I created that folder and index file for simple test and it worked as i expected.
4. Then I think that I just need to change that line to redirect into magento pub directory.
That still gave me a 404 not found error but now it was a magento error page not the apache one because files from pub directory such as error page and static files were correctly downloaded on request. I tried going to admin url and it still does not work.
Okay I don't know why that do not work so I tried to change new array key in env.php config file directories=>document_root_is_pub to false. I cleared the cache but nothing changed.
5. In the next step I decided to implement the old way of accesing magento installation. I copied .htacces_sample into magento root installation as .htaccess, copied index.php from pub into the root folder of installation and changed require path to app/bootstrap.php in it. It is important to clear the cache on this step.
6. The home and admin page works perfectly now. They gave 200 response and not a 404 error page anymore. But there are issues with static files. They now give a 404 errors because of path changes in magento 2.4.2 that i think are relative to this commit 640cad5.
I tried to change value of directories=>document_root_is_pub because I think that this config value should regulate the correct paths but nothing changed. Either it is false or true the result is the same. I looked at the code and don't see any places where this config value would somehow be used. (I found only one place where it is set into $configData)
7. So I found 2 workarounds to this problem.
Expected result
Actual result
I didn't find how to add a label for Severity so I decide to leave it here. I think that is Severity: S1
The text was updated successfully, but these errors were encountered: