When I try to complete the checkout by paying with Hosted Payment Form (mastercard module) I get an error 400 Bad request. I was reading the exception.log file and I found an error that says the following:

main.CRITICAL: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly {"exception":"[object]

I was searching in internet and tried the following commands:

export COMPOSER_HOME="$HOME/.config/composer/" export CGR_BASE_DIR="$HOME/.config/composer/global" export CGR_BIN_DIR="$HOME/.config/composer/vendor/bin"

but none of this worked yet, i'm still getting the error. Hope someone can help me. Greetings!

1 Answer 1


go to .htaccess of the store. Add this line at the top of your MagentoRootfolder/.htaccess file

  • Thanks. I solved this problem months ago, but yes, it's the right answer! Oct 23, 2019 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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