I am currently developing an app with Laravel 5 and suddenly the artisan stoped working!
I can't use a single command on it, it always return the error:
[Symfony\Component\Debug\Exception\FatalErrorException]
syntax error, unexpected ',', expecting variable (T_VARIABLE)
I tried to update via composer but when the artisan tries to clear-complie
Command: composer update
> php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalErrorException]
syntax error, unexpected ',', expecting variable (T_VARIABLE)
Has anyone ever had this error before?
My Php version is 5.6.8
Reasons why php artisan serve not working You are running php artisan serve command in wrong directory. php artisan serve is laravel command only work with laravel project. Check project directory and run in root directory of your project. The requested host or port is not available.
Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application. It is driven by the powerful Symfony Console component.
The Laravel PHP artisan serve command helps running applications on the PHP development server. As a developer, you can use Laravel artisan serve to develop and test various functions within the application. It also accepts two additional options. You can use the host for changing application's address and port.
Through your config/app. php , set 'debug' => env('APP_DEBUG', false), to true . Or in a better way, check out your . env file and make sure to set the debug element to true.
Try this command:
php -S localhost:8000 -t public
Then execute it on browser, it will produce the error, just look at the error, and fix it.
I've found the error!
I had a syntax error on my routes.php file...
function($id,**name**,**value**)
Forgot the $ sign and thus it found a unexpected ','.
Thank you all for the help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With