Already installed composer to 'C:/xampp/htdocs/crud' with cmd. However trying to install laravel via the 'composer create-project --prefer-dist laravel/laravel blog' command does not download or install anything. The 'composer global require laravel/installer' command produces the same result.
PS: don't know if it wrecks anything but, I was having trouble running the composer command at first, kept saying there is no app to open '.phar' files. I found an answer here that asked me run .phar files with php.exe by default and thats what i did.
A picture to show what happens when I run the composer commands to install laravel...
Am running laravel create project in windows command prompt like, composer create-project laravel/laravel laravel-medium --prefer-dist but am getting error like,
[Composer\Downloader\TransportException]
Your configuration does not allow connections to http://packagist.org/packa
ges.json. See https://getcomposer.org/doc/06-config.md#secure-http for details.
i don't know how to fix this issue. Please help me.
There is a discussion about this here.
You can try to run composer self-update. This will update your composer version and might solve the problem.
If it does not, you could turn ssl off, by running composer config -g secure-http false, however I would not recommend this.
Need help figuring out why I get the above error code when I run the command laravel new app-name at the command prompt.
PS: connected to internet through a company proxy
You can use this command instead of laravel new your-app:
composer create-project laravel/laravel your-app --prefer-dist
But make sure your composer is updated first. Take a look at this.
edited:
Try the laravel new your-app command after your composer update again.
Try composer global update it should work
I tried to clone some packages to my symfony projects, but it seems there are some issues with repository servers.
My command stays there for ever and does nothing:
$ php composer.phar require sonata-project/admin-bundle
Does anyone know how to work around it?
Thanks,
Hi I've recently downloaded Laravel as a PHP framework, I've installed composer and have got that working, I've got it to create my project as per the Laravel website
composer create-project laravel/laravel --prefer-dist
However when I use the above line this installs my project in the c:\users\guti directory however I want it to be installed in c:\xampp\htdocs.
I've seen another question on stackoverflow and it talks about amending the composer.json file but I'm not sure whether this is the route I should be taking as I've done a computer search for this file and this file exists as part of the laravel framework so does it make sense to amend this file?
Any composer experts on hand to point me in the right direction?
composer create-project laravel/laravel .
Installs in your current directory =)
You should specify your destination directory where you want to create the project, from the command prompt, type cd C:\xampp\htdocs then press enter. After that, type following code on the command prompt and press enter
composer create-project laravel/laravel my-laravel-project
Here my-laravel-project will be your project folder.
The composer.json file is used to setup some configurations (for Dependency management) during installation of the package via packagist.
Visit getcomposer.org for more information.
Whenever
composer create-project laravel/laravel .
Doesn't work properly for whatever reason, I just
laravel new temp
And then move the contents of the new application into the folder I do want ; )
I needed to do this myself. In the directory I wanted it installed, I did:
laravel new --force .
And it seems to be working well so far.
This works for me on Ubuntu 20.04, Composer version 2.1.6:
cd your-directory
composer create-project laravel/laravel ./
TL;DR
composer create-project --prefer-dist laravel/laravel directory-name
Move files to preferred folder if needed (e.g. to ../)
Why don't laravel new /.?
laravel new project-name not always works good on different systems, so you need to edit PATH variable multiple times to add laravel command to cli (at least on OSX it's not that easy as on Ubuntu).
composer create-project --prefer-dist . may not work because of not empty directory (e.g. in JetBrains IDE's, which creates folder .idea/ which doesn't shows in IDE's 'project' view, only on 'project files'). Exception message looks like
[InvalidArgumentException]
Project directory ./ is not empty.
So, if you know what you doing, do as you wish, on the other way, especially if you want as few problems as possible, do the steps from the top lines of this answer.
P.S. I'm speaking english not as good as i want to do, so, anyone, feel free to correct me.