Laravel 5 command php artisan... Parse error: syntax error, unexpected ':' - laravel

I was working on composer and perfect. with artisan methods I created many things.
then he was working on routes and wanted to create a Controller.
php artisan make: controller UsersController
and displays the following error
[Symfony \ Component \ Debug \ Exception \ FatalThrowableError]
Parse error: syntax error, unexpected ':'
I wanted to try commands before if they worked and did not work
you uninstall and install composer and error everywhere, not to update, install etc.
always appears the error ':'':'':'':'
[Symfony \ Component \ Debug \ Exception \ FatalThrowableError]
Parse error: syntax error, unexpected ':'
thank you for your help

I think its due to the space between 'make:' and 'controller'. I generally use 'php artisan make:controller UserController'.

Related

composer update returned with error code 1

on composer update i got this error
Script [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare handling the pre-update-cmd event returned with error code 1
It says me, that the command $PHP_BINARY written wrong or couldnt find.
this scripts are added:
scripts:
pre-install-cmd
pre-update-cmd
post-install-cmd
post-update-c
My php-version
8.1.13
System:
shopware 6
if i use --no-scripts , then the composer update is succesfully. But
I don't know what the consequences are.

Laravel 5.2 artisan error: Parse error: syntax error, unexpected ':'

Error
i am using Laravel 5.2 and PHP 7.3.12. and everything was working fine but today whenever i write any artisan command in laravel it gives this error:
[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected ':'
i don't understand why its giving this error because last night it was working fine.
There must be No extra space " " between : and list
php artisan route:list

Fresh CentOS 7, first Laravel Installation.Composer install breaks

I am fallowing this tutorial:
http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/
And on step 5) when running composer install in the project directory it starts to do staff, as expected, until this happened:
Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
Script php artisan optimize handling the post-install-cmd event returned with error code 255
What is the problem?
Thanks, Aleks
start creating a project (after updating composer) instead of downloading the referenced file do the following
from your terminal type in cd /var/www/
then type composer create-project laravel/laravel laravel-develop
your composer should download the latest version of Laravel
try it this way feel free to ask any questions.
Good Luck

getting error after checkout a new branch in Laravel

I am working on Laravel project.
I checkout new branch and it gives error "
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'Pimple' not found
"
it display the error file as 'elasticsearch/elasticsearch/src/Elasticsearch/Common/DICBuilder.php'
I run composer update,composer self-update and composer dumpautoload and it wasn't help.
Can anyone help me?
Remove dir vendor/elasticsearch and then run composer update. If you still get error, then package elasticsearch/elasticsearch is broken. You can remove package from your project in composer.json.

laravel 4 install issue when using composer install

When I run
composer.phar install
I get this error almost at the end of the installation, any ideas?
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/belendez/public_html/laravel/artisan on line 46
Parse error: syntax error, unexpected T_STRING in /home/belendez/public_html/laravel/artisan on line 46
Script php artisan optimize handling the post-install-cmd event returned with an error
I look into the suggested link and it appears that somehow in the middle of the installation it changes from 5.3 to 5.2! If I try to start installation using 5.2 it returns right a way: class 'Phar' not found. Any ideas?
It seems that issuing only a php command will pick up another version of the interpreter. Try to change all the references to php in your composer.phar file to the one you want actually to be executed (in your case it seems /opt/php53/bin/php).
You can confirm that by simply launching a php -v directly from the command line to see what version your server will pick up

Resources