2

Using laravel v8.7* Using apache server and used deployer to deploy the Laravel application on the server. Having issues once deployed to a server.

I get the following error:

PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Collection::getArrayableItems() in /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:31\n Stack trace:\n #0 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Collections/helpers.php(15): Illuminate\Support\Collection->__construct(Array)\n#1 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php(49): collect(Array)\n #2 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/ReportableHandler.php(62): Illuminate\Foundation\Exceptions\ReportableHandler->firstClosureParameterTypes(Object(Closure))\n #3 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(234): Illuminate\Foundation\Exceptions\ReportableHandler->handles(Object(Symfony\Component\ErrorHandler\Error\FatalError))\n #4 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Foundati in /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 31

Used the following instructions to deploy Note: using apache server over ngnix as apache is currently running other applications on the server.

Jojo
  • 329
  • 4
  • 7

1 Answers1

1

Have you checked if the PHP version on the droplet is the same as the PHP version you have been using locally? This looks like an error that will occur if you change versions between PHP / Laravel.

Mariann
  • 61
  • 7
  • PHP v7.4 on local and PHP v8.1 on server. Laravel v8 which needs PHP v7.3+ – Jojo Jan 25 '22 at 13:51
  • Did you also change the laravel version between local and deployed? I would try and revert the PHP version on your server to 7.4 or if you can't do that try and replicate the error on your local environment by upgrading to PHP v7.3. At least that way you'll know if that's where the issue is – Mariann Jan 25 '22 at 14:00
  • Laravel v8.8 on both local and server. – Jojo Jan 25 '22 at 14:19