title: local.ERROR: syntax error, unexpected '?', expecting variable (T_VARIABLE)
body: <p>I've uploaded my laravel 5.6 project on Ubuntu 16.04.4.
  When i upload my working project(API's tested on postman) on it, it returns a blank response and on the url it states "This page isn’t working" "HTTP ERROR 500".</p>
  
  <p>From what I've learnt is that the php version of my project and is different from the one on the server.</p>
  
  <p>My project is built on php 7.1.9 and the server php version is 7.1.18</p>
  
  <p>Any form of help or information will be useful.
  Thank you in advance</p>
  
  <p><strong>Log:</strong></p>
  
  <pre><code>local.ERROR: syntax error, unexpected '?', expecting variable (T_VARIABLE) {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThr$
  [stacktrace]
  #0 /var/www/narcodes/vendor/composer/ClassLoader.php(322): Composer\\Autoload\\includeFile('/var/www/narcod...')
  #1 [internal function]: Composer\\Autoload\\ClassLoader-&gt;loadClass('Symfony\\\\Compone...')
  #2 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/RouteCompiler.php(39): spl_autoload_call('Symfony\\\\Compone...')
  #3 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Route.php(284): Illuminate\\Routing\\RouteCompiler-&gt;compile()
  #4 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\\Routing\\Route-&gt;compileRoute()
  #5 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php(197): Illuminate\\Routing\\Route-&gt;matches(Object(Illuminate\\Http\\Request), t$
  #6 [internal function]: Illuminate\\Routing\\RouteCollection-&gt;Illuminate\\Routing\\{closure}(Object(Illuminate\\Routing\\Route), 'api/user')
  #7 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Support/Arr.php(175): call_user_func(Object(Closure), Object(Illuminate\\Routing\\Route), 'api/user')
  #8 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Support/Collection.php(657): Illuminate\\Support\\Arr::first(Array, Object(Closure), NULL)
  #9 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php(198): Illuminate\\Support\\Collection-&gt;first(Object(Closure))
  #10 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php(164): Illuminate\\Routing\\RouteCollection-&gt;matchAgainstRoutes(Object(Illumin$
  #11 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Router.php(619): Illuminate\\Routing\\RouteCollection-&gt;match(Object(Illuminate\\Http\\Request))
  #12 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Router.php(608): Illuminate\\Routing\\Router-&gt;findRoute(Object(Illuminate\\Http\\Request))
  #13 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Router.php(597): Illuminate\\Routing\\Router-&gt;dispatchToRoute(Object(Illuminate\\Http\\Request))
  #14 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router-&gt;dispatch(Object(Illuminate\\Http\\Request))
  #15 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel-&gt;Illuminate\\Foundation\\Http\\{closure}(O$
  #16 /var/www/narcodes/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline-&gt;Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
  #17 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Fideloper\\Proxy\\TrustProxies-&gt;handle(Object(Illuminate\\Http\\Request), Obj$
  #18 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline-&gt;Illuminate\\Pipeline\\{closure}(Object(Illumina$
  #19 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline-&gt;Illuminate\\Routing\$
  #20 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest-&gt;handle(Object(Il$
  #21 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline-&gt;Illuminate\\Pipeline\\{closure}(Object(Illumina$
  #22 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline-&gt;Illuminate\\Routing\$
  #23 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest-&gt;handle(Object(Il$
  #24 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline-&gt;Illuminate\\Pipeline\\{closure}(Object(Illumina$
  #25 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline-&gt;Illuminate\\Routing\\$
  #26 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize-&gt;handle(Object(Ill$
  #27 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline-&gt;Illuminate\\Pipeline\\{closure}(Object(Illumina$
  #28 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(51): Illuminate\\Routing\\Pipeline-&gt;Illuminate\\Ro$
  #29 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode-&gt;handle(Obj$
  #30 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline-&gt;Illuminate\\Pipeline\\{closure}(Object(Illumina$
  #31 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline-&gt;Illuminate\\Routing\\{closure}(Object(Illumina$
  #32 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline-&gt;then(Object(Closure))
  #33 /var/www/narcodes/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel-&gt;sendRequestThroughRouter(Object(Il$
  #34 /var/www/narcodes/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel-&gt;handle(Object(Illuminate\\Http\\Request))
  #35 {main}
  "}
  </code></pre>