Shopware 6 Server setup problem with bin/console

Viewed 823

when I'm installing Shopware 6 on my live server and try to fire the bin/console command I get the following errors:

PHP Warning: Unsupported declare 'strict_types' in ... PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ...

I've already checked my PHP version because I thought it could be caused by an old version but it is on 7.3.

Do you know what is wrong there? Am I missing something probably? I re-installed the whole shop again but I'm still not able to fire those commands.

Thanks

1 Answers

The PHP Version used in the web server can complete differ from the console one. Especially many server providers have left the operating system distributed version on cli and compiled their own versions in order to support newer or older versions than the system's one.

So, first steps should be to determine which php version you really use in your terminal:

which php

This command shows you in where all php is located in your $PATHvariable paths.

You could also try

php -v

Which shows you the php version. If there's is nothing than just the php version it's a typical sign that it is unconfigured.

Then you may look in your server's provider documentation where they have located a configured php 7.3 for the cli. It is also possible that it is not in your $PATH variable. If not, please add it as the first path, so that this path wins. It is needed, because Shopware use php scripts directly with a shell script shebang line, which determine the php binary from $PATH

If your provider use update-alternatives update the symlink with the command to 7.3 or let it be done by the server provider.

Related