[Solved] Syntax Error – Unexpected ‘)’ While Installing Magento 2.4
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:
- 2FA in Magento admin
- Seller assisted shopping
- New media gallery
- In-store pickup
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:
If you witness the above error, open setup\src\Magento\Setup\Module.php file
At line number 81, remove the “,” at last.
Your getConfig function code is as below:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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.
Any doubts can be mentioned in the Comments section below.
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
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.
6 Comments
Hi,
I was also getting the same error : Parse error: syntax error, unexpected ‘)’ in C:\xampp\htdocs\magento2\setup\src\Magento\Setup\Module.php on line 82.
As suggested, At line number 81, removed the “,” at last. but
“http://localhost/magento2/setup/#/landing”
Install option is not visible – Agree and Setup option is not visible.
Please suggest how to resolve the issue.
Hello Santosh,
You won’t be able to install Magento 2.4 with setup. You’ll need to install it compulsory with the command.
You can refer here.
Thanks.
Install option is not visible – Agree and Setup option is not visible.
Hello Jitendra,
We faced the same issue and implemented the above solution to resolve it. It works fine.
Thanks.
Damn, you are just awesome this error has got me stuck for weeks now. Thanks for your expertise
Thank you, Phillips, for such nice words!
Happy to help 🙂