"web setup wizard is not accessible" error message but the setup wizard is actually accessible
I got the error message "web setup wizard is not accessible" while accessing a magento 2 instance, before installing. This error reproduces when I try to install Magento 2 in a folder of the document root.
Preconditions:
- Magento2 version 0.42.0-beta2
- Using Xampp on Windows 7 - not sure if this is important
- Document root of server is
D:/path/to/doc_root/ - base url http://example.com
Steps to reproduce:
- Create subfolder 'magento2' in the document root.
- cd 'D:/path/to/doc_root/magento2'
- git clone https://github.com/magento/magento2.git .
- composer install
- access http://example.com/magento2/ in browser
Expected result:
- I'm redirected to 'http://example.com/magento2/setup'
Actual result:
-
I get an error message
Application is not installed yet. NOTE: web setup wizard is not accessible. In order to install, use Magento Setup CLI or configure web access to the following directory: D:/path/to/doc_root/setup
I did some digging and found that the method Magento\Framework\App\SetupInfo::isAvailable checks if setup is a subfolder of the doc root like this:
$isSubDir = false !== strpos($setupDir . '/', $this->docRoot . '/');
But $this->docRoot already has a slash at the end.
Removing the last slash solve the problem
$isSubDir = false !== strpos($setupDir . '/', $this->docRoot);
I have a similar setup using XAMPP on Window 7 and the fix is just to remove your trailing slash from the apache configuration as shown in my setup.
DocumentRoot "C:/xampp/htdocs"
Yes the code should be made more resilient but the fix should be as simple as adjusting your configuration, which at least for me did not include the slash when I installed XAMPP. Let me know if I am missing something here.
BTW: To make my development easier for me, I place several symlinks (mklink) in the standard htdocs folder pointing to my git locations. For example m2-internal, m1, m2-public, etc.
Confirmed. I'll submit a fix for it (ref MAGETWO-32365) Thank you for the detailed report.
@TexanHogman Thanks for the tips, but in this case, the problem is not that I cannot install it. I can just simply call /setup in the browser and it works. I submitted this because I think this should be fixed by the core team. Users should not need to change their server configuration to get it working. It should work for all configurations "one magento to rule them all (configurations)".
@tzyganu, fix for this issue is already published and available. Did you face with this issue after 0.42.0-beta4 release?
@vpelipenko. Thanks for the fix. I saw about 1h ago that it works on the latest version. Closing this as fixed.