Interface 'Symfony\Contracts\Translation\LocaleAwareInterface' not found - When update laravel composer - php

I Update my Laravel Project Composer, I got Following
Error. "Interface
'Symfony\Contracts\Translation\LocaleAwareInterface' not found"
how to resolve it.
My Laravel Project Version is: 5.7

do a
sudo chown -R $USER ~/.composer/
then
composer update
it should update the symfony/contracts package to the updated version.

Related

I'm trying to download Laravel 9, but version 5.4 is what I get

I'm trying to install Laravel for first time, and I want to install version 9, so I follow steps in the documentation:
composer create-project laravel/laravel example-app
cd example-app
php artisan serve
but then when I check the version, I find that its 5.4.36
and I can't find a way to upgrade it.
Note: I already have PHP 8 , MYSQL and Composer.
The 5.4.36 that you get, is the version of Laravel Installer.
if you Run php artisan --version in your folder where you installed your project you will be able to see your laravel framework version. Which should be 9.
if not try this code:
composer create-project laravel/laravel first-laravel9
Because you checked Laravel global installer version that responsible for install the full packages and laravel app, you run this command:
laravel --version
But If you want to check laravel app first install laravel app and go to the project and check the version by this commands:
laravel new example_app
cd example_app
php artisan --version
laravel/installer is a CLI tool for the init laravel project. and this cmd globally installed that CLI tool in the system. after that laravel new project-name init a project.
composer global require laravel/installer
laravel new example-app
cd example-app
php artisan serve

Cant install Laravel 6

I want to install Laravel 6 with Composer. I try with that command:
composer create-project --prefer-dist laravel/laravel laravel6 "6.*"
But i get that result:
[InvalidArgumentException]
Could not find package laravel/laravel with version 6.*.
Here is a screenshot
If i use:
composer create-project --prefer-dist laravel/laravel blog
It install the v5.5.28
Here is a screenshot
What can be the problem?
Which PHP version you are using? Laravel-6.* need PHP >= 7.2.0. Check your server-requirements for Laravel 6.*. May be you did not meeting the requirements for laravel 6.*. And after meeting the requirements run your command inside htdocs folder for xampp or www folder for wamp webserver.
your command are no longer supports so you should use:
composer create-project --prefer-dist laravel/laravel="6.*" laravel6
You forgot to add the "--prefer-dist " . So in your case, you have to use the:
composer create-project laravel/laravel --prefer-dist
in order to make it work. So just remove all the files from: d:\xampp\htdocs\laravel and then try again by following the below commands to your cmd (I guess you are using Windows!):
cd d:\xampp\htdocs\laravel
composer create-project laravel/laravel --prefer-dist
I think this should work for you just fine
You don't need to specify the version of Laravel 6. By default, Laravel 6 installs the latest version and its extension.
As I'm writing now the current and latest version of Laravel is: Laravel 6.0.4
The command below will install the current and the latest version in your laravel6 project.
composer create-project --prefer-dist laravel/laravel laravel6
You don't need to specify the version of Laravel 6. By default, Laravel 6 installs the latest version and its extension.
Via Composer Create-Project
Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:
composer create-project --prefer-dist laravel/laravel your_project_name
I think it will be helpful for you. for more details visit laravel official website : https://laravel.com/docs/6.x/installation
Please check the permissions on the cache dir (/home/keynes/.composer/cache)
It's complaining it cannot write to this dir, or it may not exist.
Maybe it is installing an older laravel version from the cache dir.
Kindly upgrade your PHP version on your system.
Then install laravel commands
It will automatically install the lettest version depends on the PHP version.
Or you can mention on laravel command and set the laravel version like "6.0*" behind the laravel installer command.
I hope this will works 😊
The commands you are running should work. I would try clearing the composer cache:
composer clear-cache
and then
composer update
composer create-project --prefer-dist laravel/laravel="6.*" laravel6
before trying again. Looking at the screenshots there seem to be some permissions errors in the ~/.composer directory. This might also cause the composer clear-cache command to fail with an error.
So if clearing the cache doesn't work or you get an error, you might try moving the ~/.composer directory to a backup location, to force composer to regenerate it's settings.
mv ~/.composer ~/.composer.backup
And then try it again (be aware that composer update will likely take a noticeably longer time than usual and might be unresponsive for a while):
composer update
composer create-project --prefer-dist laravel/laravel="6.*" laravel6
If it still doesn't work, then you can restore the backup:
rm -rf ~/.composer
mv ~/.composer.backup ~/.composer
Then looking at the output of
composer config --list --global
might help determine the next thing to try.

How to update Laravel command?

I used this command for installing Laravel:
composer global require "laravel/installer"
For creating a project I use :
laravel new project
Today Laravel 5.7 was released, and I'm looking for installing it using the laravel command but I couldn't do it. Instead, a new laravel project was created with Laravel 5.6.33. I need some help.
Note: I can create a project with Laravel 5.7 with this command, but I need to update my required Laravel and make a project with laravel 5.7 by using the laravel command:
composer create-project --prefer-dist laravel/laravel blog
If you want to globally update Laravel to the new version just run
composer global require laravel/installer`
to update globally
Update your laravel/framework dependency to 5.7.* in your composer.json file.
Run this command
composer update
composer create-project --prefer-dist laravel/laravel blog
Try this to update laravel installer on global level:
composer global update
I think that Laravel 5.7 Installation Documentation, has the exact instructions for your problem.
Install the Laravel Installer via composer: composer global require "laravel/installer"
Run the command: laravel new <project-name>
try this command
composer create-project --prefer-dist laravel/laravel blog "5.7.*"

Laravel 5.5 install

When I try to install Laravel 5.5 with laravel new project --dev
[Symfony\Component\Debug\Exception\FatalThrowableError]
Parse error: syntax error, unexpected '<<' (T_SL), expecting ']'
It is just me or because it is not release yet?
EDIT:
Btw, it is when I try to make php artisan key:generate... If I put any key in .env it works...
Thanks
composer create-project laravel/laravel blog "5.5.*" --prefer-dist
To install Laravel 5.5 you need launch composer create-project as usual and you need to set the “dev-develop” version of the laravel/laravel package:
composer create-project --prefer-dist laravel/laravel blog dev-develop
Where:
laravel/laravel: is the package for Laravel installation;
blog: is the new directory for your new project (you can change it);
dev-develop: is the next version of Laravel.
Yuo can find more information here
https://medium.com/#robertodev/how-to-install-laravel-5-5-dev-d721873a8c89
I had the same problem.
For me even
php artisan
did not work.
I fixed it with a simple
cd /my/project/folder
composer update
php artisan key:generate
in the console.
Hope this helps.
This is happening because of your Laravel Installer version. I have faced the same problem.
Run following command:
composer global update (it will update your Laravel Installer)
If you don't want to install again, then fix by following command:
composer update (from your project directory and it will update your project files)
Additional:
Sometimes, it may cause of Composer version. You can update your composer version by following command:
composer self-update
Then you can update your project files.
Hope this answer will help you.

Installing Laravel

I am on a windows 8 machine and I'm trying to learn laravel. I copy and pasted my PHP folder from C:\xampp to C:\php, installed composer, ran composer install then composer create-project laravel/laravel learning-laravel. So far everything was created so I went into the directory and tried to use 'php artisan serve' and got the following error.
C:\Users\denni_000\learning-laravel>php artisan serve
Warning: require(C:\Users\denni_000\learning-laravel\bootstrap/../vendor/autoloa
d.php): failed to open stream: No such file or directory in C:\Users\denni_000\l
earning-laravel\bootstrap\autoload.php on line 17
Why you copied php folder
download composer install it.
download laravel latest version and store it on your xampp/htdocs/laravel
and run cmd with composer install command
For more follow install laravel on windows xampp
or Laravel 4.1 installation with composer in xampp
For windows Simply download Laragon which includes latest php 5.6.7, Apache, Mysql, Redis, Memcached an alternative to Xampp or Mamp with small size. Easy to install laravel and create project with auto create virtual host by it. Thank you.
U need to go to the directory where laravel is installed and run the following command.
composer update
Install Laravel 4.2 with composer:
sudo composer.phar create-project laravel/laravel project-directory-name 4.2 --prefer-dist
Here is a different way to setup laravel, may be you guys will like it
Step 1:
Clone https://github.com/laravel/laravel or you may download zip also.
Step 2:
Navigate to downloaded folder in command prompt and run composer install
Step 3:
open the folder and rename .env.example to .env and update the credentials mentioned in file.
Step 4:
After these steps if you navigate to the directory from web-server it will cause an error No supported encrypter found. The cipher and / or key length are invalid. to fix this just run php artisan key:generate
Done!
Hope you guys like this way :)
You need to install all the laravel required dependency.
To do that, you need to tell composer to install everything needed.
Below is the command to use to install that's required in laravel composer.json.
composer install
Follow the installation guide from Laravel
Install Composer:
Like Laravel.com says: "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system."
Type the following statement in the command line:
composer global require "laravel/installer=~1.1"
Create a fresh Laravel project in a specified directory with the "laravel new" command:
laravel new blog
You can also create a Laravel project using composer, like such:
composer create-project laravel/laravel --prefer-dist
If you want to learn laravel I seriously recommend you use laravel homestead with vagrant.
For this you need to:
Install virtualbox.
Install vagrant.
Install git.
Install ssh.exe (Download msysgit and copy the content of bin folder to git bin folder).
Install Homestead on Vagrant (Follow the steps on laravel/homestead documentation page).
Install Laravel on Homestead (Follow the steps on laravel/installation documentation page).
This method apply to Windows, Linux or Mac, only change the step 4 on linux or mac.

Categories