Sounds like the command line is using the wrong php version.
You need to ask your host how to use the right version on the command line.
Verify this with php -v
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have built a Laravel 5.7 site locally and I am now trying to deploy it to a remote shared webserver. I am half way there, but no images are showing though they exist in the right folders and also when I try to run "php artisan config:cache" I get the above error message about a missing '?' in "/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500".
All the answers I have seen after googling the solution has been that I need PHP7. But the thing is that I do have that. Locally where everyting works I have PHP 7.2.3. and on the remote server I have PHP 7.2.10 (there are 2 more versions to choose from, but the problem is the same for each of these.
What do I do? Maybe I should mention that I haven't got access to composer on the remote server, so I have transferred all vendor files manually with Filezilla.
Sounds like the command line is using the wrong php version.
You need to ask your host how to use the right version on the command line.
Verify this with php -v
Please or to participate in this conversation.