I've recently updated a few of our projects to Magento 2.4 and they all consistently fail when trying to deploy them to a server.
When I upgrade our projects the upgrade goes great, not really any issues but when I run the project locally I always get the
Parse error: syntax error, unexpected ')' in /opt/atlassian/pipelines/agent /build/setup/src/Magento/Setup/Module.php on line 82
error locally. This is locally easily fixed by simply removing the comma after
include __DIR__ . '/../../../config/languages.config.php'
on line 81.
However whenever I run our deployment scripts, in which we run several magento commands, the deployment script always fails with the above error. I have tried uploading my local setup folder to our git environment to see if that would work during deployment, but to no avail, the error keeps happening. (Is the setup folder being overwritten on a new install? The team that handles our deployment tell me they have no information on this, as it's with magento, not with their deployment scripts)
I then installed a blank magento 2.4 project and noticed that comma on line 81 is in the blank version of magento 2.4!
Does anybody know what is going on here? It does not seem like anybody else is experiencing this problem? I've tried rerunning the entire update process from version 2.3.3 to 2.4, 2.3.5 to 2.4 and they all have this error. Any solutions?
You must be using less version than PHP7.2, please upgrade your PHP version to greater than PHP 7.2.
and your live server must have different php version, please check once.
I am using php 7.3, and our server is also set to php7.3, including within our deploy config.
can you try once with PHP 7.2, make sure you restart the server after changing php version.
as this error occurs only because of PHP version.
and also confirm that your Magento is picking the correct php path.