php artisan serve gives me PHP parse error , syntax error , unexpected '=' in Arr.php on line 388

July 14, 2019 734 views
LAMP Stack Debian 9 PHP PHP Frameworks

Debian 9
Apache 2
MariaDb
PHP 7.0.33
installed composer
installed laravel globally

Attempted to update to PHP 7.2 by…
sudo apt update
sudo apt install php7.2 but get error unable to locate package

the Arr.php file is in \vendor\laravel\framework\src\Illuminate\Support

1 Answer

Hello,

Indeed I believe that this is due to the PHP version, can you confirm your current PHP version?

You could try following the steps here on how to install PHP 7.2 on Debain:
https://linuxhostsupport.com/blog/how-to-install-php-7-2-on-debian-9/

Hope that this helps!
Bobby

  • Thanks Bobby, that did it. I upgraded from 7.0.33 to 7.2.20 and now I can run ‘php artisan serve’ in my project folder.

    • Perfect! I’m happy to hear that it is working now! Make sure to mark the answer as correct so that other people would know that this fixed the issue for you.

      Regards,
      Bobby

Have another answer? Share your knowledge.