0

A friend uses Craft CMS (3.7.40). He is not a IT guy, so he asked me to help him. I haven't worked with Craft CMS yet, but I figured his problem would be easy so solve: he would like to use Google reCaptcha for the contact form. I took a look at the plugin store and there are several free plugins which should solve this.

So I tried to install this one: https://plugins.craftcms.com/craft-recaptcha and after some minor issues (had to set allowAdminChanges to true) I finally saw the install button and pressed it. After the installation it says the plugin was added, but an error occurred:

Invalid plugin: No plugin exists with the handle "craft-recaptcha".

I did some research and if I don't revert the failed installation, I can find the plugin in the composer.json 'require' section, but no database tables and no record in the plugin table were created.

Does anybody know why it fails? It seems like a database problem... and it seems like nobody else run into that exact problem, at least I didn't find anything in Google. The web.log show this line:

2022-08-28 16:44:15 [-][3][-][error][craft\controllers\BaseUpdaterController::installPlugin] Plugin installation failed: No plugin exists with the handle "craft-recaptcha".

Does anybody have any idea what I am doing wrong?

1 Answer 1

2

Did you install this plugin on a production server? There are a few things that should be taken into consideration:

allowAdminChanges should preferably always be false on production/staging environments. And only enabled in a local development environment.

To install a plugin you'd run the composer require vendor/plugin part. After that has run you can use the Admin Panel or install the plugin through the CLI with php craft plugin/install plugin-handle which will install the plugin for you.

You'll notice once you push up and are ready to deploy the code you have changes in the project config file.

To make sure then those changes reflect on the production/staging server you'd need to run:

php craft up which will apply the changes you made locally to the database structure and run any migrations if they're necessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.