This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

Can't log in or register in 3.0

In UserSpice 3 · Started by CuChulla1nn on 2016-01-20 2:38 pm · 52066 views · 19 replies

Hello there,

I just found out about UserSpice and it looks exactly like what I need. So I tryed to get it running on localhost to see if I can get it build into my current project. Setup worked fine but I cant register or log in. I changed the reCaptcha with my own from google and it is working as far as I can see. But when I submit the form the request times out.

Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify?secret=6Lfp4xUTAAAAAEFmPs29eDI9XFIXQC7LVPcQakbV&remoteip={3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}3A{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}3A1&v=php_1.0&response=03AHJ_VuuP-egxBbmID5rTacleOpCTwDwrfYU8_09mKPl7uQ3tv6lg7rjjYMQFanDgJg1qSJizw-Uu3iB5lhGdWi6rzo3EJwItFGDKKSG6aKA9l9Qg2ebM5_yMuRr9z4RgK3UhGBoTT-clnaFPddYKJ1WEzR2fKUz2xLq2mvML_cMfS3VQgN9GhaD3HlcmiiPD9QeC0yTf7jBQJvp6LnmuRZwpoL6-UEJNy3NVkoGgmiZcUh0jk_xYOYmF29SItNE3wgzWZRQ0h8wvPvVseTb-dnqn6hKiIexVGpRAfsqlsVSs2mji9n3tFLsPm9QQYVQwdpgXkVFD51nhxfqok1F97ieknImdAJ9JYFfgs6l8cCyWvJPTzx12dwGMzYgmIN1Uc5fJtguQ9e6lWaJjoUuHKpaVfVH83wi3_wt5yGsp5lcKpwXbeb1RCucu2IjkC5PnnoRQUE95lEV6YmIcDkU2mP03_M-vX410rXaxvxjkQL0Ny41i5CG-aROt-kz3acK5QjYDDZmpgsk750S0EOZAYBNQgwFxnOiWFr2AbLSF49MbvSUtThGBcegXEdLE5YhrchmBPn-nC0fQrCCMH50r4dcG8taTZ0xEEhHKq2lpJYlYwdmrYpNoRETywLQFMKQstKVROHI2RR_vZtIadf5hhbSmQPKDGPIxNwYR38hg1sDQk5mi6OTXrkpU0TsUH3KmFD1prO20oxhlXHqgZ3QS7DmNeCI2BqClzwgE2Xkw-hYQvsu8FmwGGUB_8vGbcsbQ0GdYSnYYvk362fJp1jZIRMIk6rPnBhcVkDVHDRNqxwK-VIAPwtdm49ih3E050CmEJXylckbdhyZSpLVuvmBf3ow63e8y in C:\xampp\htdocs\usercake\models\recaptcha.config.php on line 68

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\usercake\models\recaptcha.config.php on line 68

I tried to figure out where the problem lies but I am kind of lost at the moment.
If you have any idea I appreciate the help.

Best regards
When you say you changed the recaptcha with your own, do you mean that you changed the recaptcha key or the whole recaptcha?

Did you put your key in models/settings.php?
Also, did you generate a new set of keys -- both public and private or are you using existing ones from something else? If you haven't done that, you probably want to.
Two other things to try...if you have access to your php.ini in something like WAMP,

Increase the max_execution_time in php.ini then go to

C:\wamp\apps\phpmyadmin3.4.10.1\libraries (change path according to your installation)

open config.default.php and change value for $cfg['ExecTimeLimit'] to 0:

$cfg['ExecTimeLimit'] = 0;

----OR----
On XAMPP
1) Go to xampp\phpMyAdmin\

2) Open config.inc.php.

3) Search for $cfg['ExecTimeLimit'] = 300; //whatever value is here

4) Change to 0 for unlimited or put a larger value.

5) If not found, look in xampp\phpMyAdmin\libraries for config.default.php

Let me know if these fixes don't work for you ...there might be some others.
6) Search for $cfg['ExecTimeLimit'] = 300;

7) Change to 0 for unlimited or put a larger value.

8) Save the file and restart the server.
I'm getting the same issue.

I built my site on local and it all works fine. Upload it to the webhost and I can't login or register.

I generated both recaptcha keys and updated them in settings.php

It is correctly connecting to the database... but not logging in.
Btw, there is no error at all.. it just refreshes the page and nothing else happens.
Well I tried around a bit.
The steps you posted didn't work. But I installed UserSpice locally on my other computer at home. There it works fine.
I use the same reCaptcha Keys in both setups. Also I changed the keys not the reCaptcha itself. I generated the keys just a couple of hours before my post here.

Could it be a problem that I have a proxy working on one setup? For now I can work freely on my other setup and I have no problem there.

If I can give you any information to solving this problem. Let me know.

That's definitely weird. It's obviously some sort of server configuration issue. I'm using a very stock implementation of the google recaptcha implementation. I'm going to email you something to check
2 things I would check:

PHP version on the remote host
Differing domain name on the remote host
Php on remote host is 5.4, 5.5 or 5.6 (You can choose, and I've tried each to no avail).

I don't understand what you mean about differing domain, or why it would be an issue. I don't see any config regarding domain, tut I noticed that my config didn't have Website URL updated for the remote host, so I've now updated that, but it didn't fix the issue.
I'm going to email you a test file to see if that works.
So I got my webserver and uploaded it. Database is set up and website running but now I got the same problem as @evilme73. When I try to register or login the page refreshed without error. No entry in the database either.

I also emailed you back on the instructions you send me.
PHP must be 5.5 or better.

In uc_configuration there is a key named website_url - is it correct for your remote domain? Has a trailing slash?
This is used when refreshing and redirecting, could be related.

I've tested numerous versions on my setup (PHP 5.5.9-1ubuntu4.11, Apache/2.4.7 (Ubuntu), mysql Ver 14.14 Distrib 5.5.44) without any problems.

What server and version are you using? Can you see any errors in the logs?

Maybe enable some error reporting at the very top of top-nav.

error_reporting(E_ALL);
ini_set('display_errors', 1);


I can pretty definitively say that this is an issue with the fopen settings on people's servers. I am going to roll out a version 3.1.1 to give two mitigations and some diagnostics on this issue.

I've already emailed CuChulla1nn, but here are the checks to perform for anyone else who experiences this

Add or uncomment out these top two lines on register.php (they're included in version 3.1.1 and beyond)
error_reporting(E_ALL);
ini_set('display_errors', 1);

Try to register again, and the error will pop up in the header of the site. It will most likely say something about fopen (which is required by reCAPTCHA). Different servers handle this differently, which is where the problem comes in. Some servers can be fixed by adding the following line to the top of login.php and register.php (which was added in 3.1, I believe), but older versions don't have it:

right above the require_once
ini_set("allow_url_fopen", 1);

BUT, some servers don't seem to be respecting that, so the next step is to add a php.ini file wherever you installed UserSpice (this will be included in 3.1.1 and later). The PHP ini should just say:
allow_url_fopen = on

If that doesn't work, you're going to have to talk to your hosting provider or dig through your php.ini file for the server to enable url_fopen.

I hope that helps, and thanks to all of you who didn't just dump the software but decided to press on and help the entire community find a fix for this problem.
Good news; There are for and against argument on the subject of enabling url_fopen.

For our scenario, I think the provision of the captcha outweighs the perceived security risk.
I think that's why the ideal solution is to enable it only for the login/register pages but for some people that doesn't seem to be an option.
Thanks for your help mudmin, my site is now up and working... glad I could help tracking down an issue other people are experiencing too.
You wouldn't think recaptcha would be such a big deal since everyone uses it, but not every server plays nicely with it. Glad it's working for you!
It took some time but it works now. Problem was that in the end url_open was disabled on default by the provider. Now I can sign up and login.
What method did you use to enable it. Some people were able to do it by adding something to the top of the login/register file. Some people could do it by adding a php.ini.