I checked php version and really the new one had newest. I changed to 7.0 and it works back but without images When I try run any of these commands:
php bin/magento setup:static-content:deploy -f php bin/magento cache:clean php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f
I always get:
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/annmar/websites/www/bg/vendor/magento/framework/App/Bootstrap.php on line 411
@ann_mar Can you run the command "php --version" on the command prompt and see that you get the same PHP version you are looking for.
Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.
When I checked in file .php (<?php phpinfo(); ?>) i get PHP Version 7.0.33 and the old server have PHP Version 7.0.24. I don't have access to old one but when I use command php --version on the new server I get:
PHP 5.4.16 (cli) (built: Oct 30 2018 05:43:23)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
I don't know why 5.4?
@ann_mar You can ask your hosting provider to make those updates for you. As I said in one of the previous comment you can have different PHP version for Web and command line. This need to be fixed to make the thing working for you.
You can also try command like below. May work otherwise you have to get the version for CLI fixed.
/usr/bin/php7 bin/magento cache:clean
or
/usr/bin/php70 bin/magento cache:clean
Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.
I tried on another server and everything works! It actually had to be a php problem. Do I still need to run any command after running on a new server?