After I deployed my laravel app on shared hosting, I am getting a HTTP ERROR 500.. I checked my error log file and saw this:
PHP Parse error: syntax error, unexpected '?' in
/home/shelterm/public_html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500
if (isset($arguments[1]) && is_string($arguments[1])) {
return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);
} elseif (isset($arguments[1])) {
return $factory->of($arguments[0])->times($arguments[1]);
}
The same laravel app works perfectly on my localhost(XAMPP)
PHP Version 7.3.1
According to the Laravel manual, Laravel 5.8 needs the following requirements:
So, your problem is the php version you use on shared host.
On Your Server Panel Home, Look for Software Tab and Select MultiPHP Manager
Go to MultiPHP Manager Select the domain, Locate PHP version, Change the php version to Latest version and apply..
You should see the available Php versions on your shared hosting server, select the Latest and apply
Done
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.