Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Cannot login to CMS after install (Windows 8 install, localhost using xampp)


Go to End


7 Posts   3043 Views

Avatar
concretekiwi

Community Member, 4 Posts

21 July 2015 at 12:36pm

Hi,

I've installed SS before with no issues and made a basic site, but it's been a while and on this clean install I'm having trouble. If you have time to review my install steps below and offer help I'd greatly appreciate it. I've probably just overlooked a setting or step.

Install steps

  • Installed Composer using .exe file for windows
  • Installed SS via Composer from commandline with "composer create-project silverstripe/installer C:\xampp\htdocs\ssSite 3.1.13"
  • Set up a db and user in phpmyadmin via xampp
  • I visit the site url and see the install page as expected.
  • I have enable fileinfo as suggested, but opted not to add tidy support or display errors
  • I entered in my db info (using mySQL 5.0+) and re-checked requirements, and this passed.
  • I entered CMS account details. Email = ssAdmin. Password = password. Re-checked requirements, and this passed.
  • I selected Empty Template for the theme. Re-checked requirements, and this passed.
  • I clicked the Install Silverstripe button

Issue
After installing, I see the confirmation page advising me that it is redirecting me ("Friendly URLs set up successfully; I am now redirecting you to your SilverStripe site..."). However this hangs, and eventually Chrome will time-out and tell me that the page has a redirect loop.

However if I visit the page via the url directly, it now shows the site (including the default theme for some reason, even though I opted for an empty template install).
I can follow the cms link in the intro page (or append /admin to the url. Same thing) and get to the login page.

If I enter the correct details, it redirects me back to the same login page (Message remains as "Please choose an authentication method and enter your credentials to access the CMS.").
if I intentionally enter incorrect login details it gives me the message: "The provided details don't seem to be correct. Please try again."
So I believe that I am logging in with the correct details.

I've spent some time googling and going through these forums, but haven't found a solution that works for me.

Troubleshooting Steps
(between each step I deleted the install files, deleted the user & db, recreated user & db, cleared my browser cache, and reinstalled SS via composer)

  • I can't use the password reset, because I opted for a username without an email address (e.g. 'admin' as per the default).
  • I tried an install where the Email address for CMS access was ssAdmin@example.com instead.
  • I tried an install with Simple selected as the theme.
  • Added ?flush=1 to the url of the site to try and refresh.
  • Tried installing an older version instead "composer create-project silverstripe/installer C:\xampp\htdocs\ssSite 3.1.8".
  • I tried to login with email 'sss' and password 'sss' to confirm that I got an error message. I then added to the file mysite\_config.php "Security::setDefaultAdmin('sss','sss');" and this gave me the same behaviour as using the correct username password that I originally set up (redirect back to login page). I feel that behaviour this confirms the username and password are correct.
  • My localhost is on port :8080. I don't think that should have an impact, but I did go into cms\_config.php and try to change "define('CMS_PATH', BASE_PATH . '/' . CMS_DIR)" to "define('CMS_PATH', BASE_PATH . ':8080/' . CMS_DIR);" as an experiment. But it made no difference. Have changed it back to default.

So I'm stumped. I think on my laptop I installed successfully using the new bitnami package, so I might try that on this PC. However I'm going to rest this project for 24 hours to see if there's any other solution first. I'd really like to know what I've done wrong. It's probably something really simple.

Thanks in advance for your help

Avatar
Pyromanik

Community Member, 419 Posts

21 July 2015 at 11:41pm

Edited: 21/07/2015 11:44pm

Well, it seems you're doing everything right.
Since it's a dev site, you have a few options available:
change the username in the database (Member table) to be a qualified email address. This will probably work because iirc xampp sets up a mail server to enable sending.
The other (more common) method is to set a 'default admin'. But it seems like you've tried that too.

From your description it sounds like you're using an old version of silverstripe, but you're using composer so that shouldn't be the case.
It could be a mismatch with PHP version in xampp. Hopefully you've got a recent install though so that shouldn't be it.

A php error during admin load or member checks can cause a redirect to the login screen. This can be confusing as it appears like your login was insuccessful - however isn't the case. Try setting up some file logging and see if anything useful comes out there (errors displayed to screen aren't shown because of the redirect).

Avatar
concretekiwi

Community Member, 4 Posts

22 July 2015 at 9:52am

Hi Pyromanik,

Thanks for taking a stab at resolving. Good points.

Version
I thought maybe the php version mismatch might have been an issue, but I have php 5.6.3 which I think is compatible according to the Silverstripe requirements page (although i did notice it doesn't list Win 8 support. However my laptop was win 8.1 and that worked). This week I was thinking about trying out php 7 beta 2 when it comes out, to see how much faster it really is. Good thing I didn't add that chaos to the mix as well!

Logging
I checked Apache access logs, and it looks like successful 200 codes returned for the redirect.
Apache error logs don't show anything out of the ordinary (other than a few times when I accidentally used the incorrect syntax when trying and add default admin like you suggested).
Php error log doesn't seem to show anything strange.

I added the if(!Director::isDev()) block from http://docs.silverstripe.org/en/3.3/developer_guides/debugging/error_handling/ in my mysite/_config.php file. I couldn't find any logs being generated though. I feel like this would trigger though only after the user validation is done (e.g. isDev) so I might have been looking at the wrong docs to resolve this. I'm not sure if that was the logging you were referring to. Good suggestion though. My apologies if I misunderstood.

Bitnami
I did attempt this morning to install the Bitnami version, in the hopes that it would be nicely encapsulated and a bullet-proof config that would run anywhere. Sadly, it threw up lots of errors during install and didn't work when launched.

Environment
So I've come to the conclusion that my local environment here is probably incompatible somehow (thanks to lots and lots of experimenting with different languages and frameworks over the years). I think I really need to look into VMs (e.g. Vagrant) or docker containers to ensure that everything is properly isolated. Will help a lot with deployment consistency too I suspect. I've heard that Common Web Platform is a thing here in NZ, so one day I'll dedicate some time to setting up a VM environment that matches their criteria.

However I have to move forward with this project so I'm just going to rest Silverstripe for the moment. I appreciated your efforts to help though.

Avatar
Pyromanik

Community Member, 419 Posts

22 July 2015 at 10:06pm

Two small things to add for future then:
Silverstripe will log it's own errors - but you must set up the error handler to do so. There should be docs for this, but it's basically some stuff entered into the _config.php iirc.
200 OK is impossible for a redirect, unless it happens client side. Redirects are 301 or 302. It's best to open web tools and set the network tab to persist in these cases so you can see what's actually happening as it happens.

Zauberfisch maintains a box for silverstripe with vagrant, iirc all set up and ready to go. Get started in just a few minutes with a reasonably clean environment. Of course though spending more time and trying to get your dev env. as close to your live env. is more preferable.

Avatar
concretekiwi

Community Member, 4 Posts

23 July 2015 at 12:23pm

Nice one, I think i found it,. Thank you. I'll give it a crack when I come back for another try. Just hacking my way through another CMS at the moment, but I'll be back for sure :)

Avatar
Pyromanik

Community Member, 419 Posts

23 July 2015 at 10:45pm

Naw, Deploynaut is Silverstripe (Ltd.)'s deployment platform.
This one is what you're after: https://vagrantcloud.com/zauberfisch

Avatar
concretekiwi

Community Member, 4 Posts

23 July 2015 at 10:50pm

Sweet, thx Pyromanik