Support the ongoing development of Laravel.io →
Installation

Hello guys, I was trying to install new laravel app but i keep getting this error after runing this command laravel new repo-laravel

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/user/repo-larvel/artisan on line 31 Script php artisan clear-compiled handling the post-install-cmd event returned with an error

will realy appreciate you guys...

Last updated 2 years ago.
0

Can you mention the source from which you were taking guide for installation. I hope you are using none other than this http://laravel.com/docs/5.1#installation

0

I was able to resolve this issue. I was using php 5.4.x of which when using composer create-project command it fetches the current version by default. So i upgrade my php version to 5.5.x

thanks

0

Same error on WAMP with PHP 5.6.11: any help, please?

0

I had this same error. MAMP PRO 2.1.2 on a mac with PHP 5.5.3. I solved it when I realized that running PHP was using the system PHP. I added the 5.5.3 bin directory to the end of my path, but it could also be solved by aliasing php to the appropriate version binary.I had this same error. MAMP PRO 2.1.2 on a mac with PHP 5.5.3. I solved it when I realized that running PHP was using the system PHP. I added the 5.5.3 bin directory to the end of my path, but it could also be solved by aliasing php to the appropriate version binary.

0

@diemer is correct. I replaced the usr/bin/php file with usr/local/php5-7.0.10/bin/php file and it worked.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.