🔥 Just Launched! Werra Premium Template for HyväSee it in Action

[Solved] Syntax Error – Unexpected ‘)’ While Installing Magento 2.4

By Jignesh ParmarUpdated on May 22, 2025 2 min read

The latest Magento 2.4 is released on July 28’20.

No doubt, any store owner will be prompted to download Magento 2.4.0 and install it to leverage the latest features like:

Not forgetting the 98 new features, 68 bug fixes, 50 security changes, and Php 7.4 support!

However, merchants are facing a syntax error – Unexpected ‘)’ while installing Magento 2.4.

Developers at Meetanshi immediately jumped on this error and here’s the solution:

Solution for Syntax Error – Unexpected ‘)’ while installing Magento 2.4:

Syntax Error - Unexpected ')' while installing Magento 2.4

If you witness the above error, open setupsrcMagentoSetupModule.php file

At line number 81, remove the “,”  at last.

Your getConfig function code is as below:

public function getConfig()
{
    // phpcs:disable
    $result = array_merge_recursive(
        include __DIR__ . '/../../../config/module.config.php',
        include __DIR__ . '/../../../config/router.config.php',
        include __DIR__ . '/../../../config/di.config.php',
        include __DIR__ . '/../../../config/states.install.config.php',
        include __DIR__ . '/../../../config/languages.config.php'
    );
    // phpcs:enable
    return $result;
}

That’s it.

You can simply skip this error and opt for Meetanshi’s Magento 2 Upgrade Service to upgrade your store to the latest Magento 2.4.3 version.

Please share the solution with the Magento community via social media.

Thank you.

Jignesh Parmar Full Image
Article byJignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.