I am finishing up an upgrade from EE3 - EE5 and ran into an issue with the native Captcha feature.
Since the upgrade, I haven’t been able to get Captchas working - the form shows the “Enter the grey word” but no image – it doesn’t appear that the images are being created in the image/captchas/ folder.
I have made sure to: - check permissions on that folder, they are set to 777 - toggle off/on True Type - flushed all the caches - made sure GD was enabled w JPEG support
I have exhausted all the ExpressionEngine forums and troubleshooting guides and google. (https://docs.expressionengine.com/latest/troubleshooting/templates.html#captcha-images-not-appearing)
There are no errors in the console and no clues that I can find in the logs. There are still records in the database, and I compared all my local files to the EE files on Github and they are consistent.
I just did a quick local test and captchas are working for me. So I’m thinking it’s something quirky, but you’ve covered all of the typical quirky stuff.
I think we already discussed going with a third party add-on, in which case, I’m not going to dig in further at this point.
But agreed- it really makes no sense given it worked before and you’ve run down all of the typical issues.
There is a known bug with the wordlist override: https://github.com/ExpressionEngine/ExpressionEngine/issues/476 but it doesn’t look like that’s applicable here.
> I’m concerned that there’s something deeper messed up, but this is my first EE project, so I am not sure.
Me too- both the native captcha and recaptcha tend to ‘just work’.
If it were me, I’d get support for a month and have us (aka me) go in and figure out what’s going on.
But if that’s not an option, we can try working through the native captcha again here. Remind me- did we enable EE logging so we had a file log of what was happening when it should be creating the word list. It really feels like an error somewhere.
And- trying with extensions disabled.
We have tried logging – I don’t think support is an option. we’ve already spent quite a bit of money on addons.
I disabled extensions and the frontend doesn’t load, except for a hash {123.....1231}
, but that is probably normal, I’m guessing. Admin section loads just fine.
This is the disabled log:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
DEBUG - 2020-08-03 09:40:16 --> Utf8 Class Initialized
DEBUG - 2020-08-03 09:40:16 --> UTF-8 Support Enabled
DEBUG - 2020-08-03 09:40:17 --> URI Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Router Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Output Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Input Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Loader Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Controller Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Helper loaded: language_helper
DEBUG - 2020-08-03 09:40:17 --> Helper loaded: string_helper
DEBUG - 2020-08-03 09:40:17 --> Helper loaded: file_helper
DEBUG - 2020-08-03 09:40:17 --> Database Driver Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Model Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Model Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Localize class already loaded. Second attempt ignored.
DEBUG - 2020-08-03 09:40:17 --> Remember class already loaded. Second attempt ignored.
DEBUG - 2020-08-03 09:40:17 --> Localize class already loaded. Second attempt ignored.
DEBUG - 2020-08-03 09:40:17 --> Helper loaded: multibyte_helper
DEBUG - 2020-08-03 09:40:17 --> User Agent Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Language file loaded: language/english/core_lang.php
DEBUG - 2020-08-03 09:40:17 --> Database Driver Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Database Driver Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Language file loaded: language/english/template_router_lang.php
DEBUG - 2020-08-03 09:40:17 --> Api class already loaded. Second attempt ignored.
DEBUG - 2020-08-03 09:40:17 --> Model Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Database Driver Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Language file loaded: language/english/stash_lang.php
DEBUG - 2020-08-03 09:40:17 --> Model Class Initialized
DEBUG - 2020-08-03 09:40:17 --> URI Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Database Driver Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Database Driver Class Initialized
DEBUG - 2020-08-03 09:40:17 --> Final output sent to browser
DEBUG - 2020-08-03 09:40:17 --> Total execution time: 0.1513
Looks like the conditional checks to see if the captcha tag is on the template”
if (strpos($str, "{captcha}") !== FALSE)
If it’s not, it doesn’t bother making the word.
I just looked at my working template- it has:
{if captcha}
<label for="captcha">Please enter the word you see in the image below:</label>
{captcha}
<input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
{/if}
So that should do it. I’m vague one why it changed, though. Oh- and it wouldn’t surprise me if that’s the problem with reCaptcha- it might be matching on that.
Man- weird one. But good debugging on your part.
AHAHAHA dang it. Yep, I’d have never thought of that. But thanks for solving the mystery. I’d bet it will help someone in the future.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.