Search code examples
phplaravel-5easyapache-4

EasyApache only applies PHP7 to public_html?


I'm using EasyApache 4 and Laravel 5.5 to deploy an API on a shared host. I got the project running at same level than public_html. In public_html, there's only project's public_html files. Now if I access my routes, they work fine. They where not, before, I was getting this error, which means it was not running on PHP7. So I fixed with EasyApache and run PHP 7 on that account.

The problem If I access server trough ssh, cd to project's folder and run:

php artisan db:migrate

I got the same error again:

Parse error: syntax error, unexpected '?' in /home/someaccount/project/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233

And if I google, that's the cause: the project is running on PHP < 7. So that's my question: does EasyApache only applies PHP versions on public_html folder?

UPDATE: I got full access to WHM and SSH, is there a way to make PHP 7 default?


Solution

  • Solution Call this /opt/cpanel/ea-php71/root/usr/bin/php artisan db:migrate