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.
Related
I'm trying to upload a plain laravel v5.8 project to a server. It gives me this error
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5".
I updated the Laravel version to v6 and it still throws the same thing.
Is there any possible solution I tried many but nothing happens. Thanks in advance.
I faced this problem using the new version of composer, didn't have seen this issue before, although this question is a bit old the solution can help someone else.
I did this working in a development machine, if you really need to change the PHP version running in your server this isn't for you.
This problem is related to a composer configuration when you run the command "composer install" if you need to work with the configuration you already have and don't want to make changes which could lead to other problems you should:
remove the packages you already have installed which includes this configuration from composer
sudo rm -r vendor
run the command again with this flag: --ignore-platform-reqs
composer install --ignore-platform-reqs
Now composer won't perform this check anymore and you are good to go!
I followed all the instruction by installing composer and then Laravel. Also I did everything what was shown in laracast series for installing Laravel and composer.
BUT I have some problems and I cannot solve them:
I don't have Vendor folder in my Laravel app folder
I cannot launch command 'composer artisan' as it says that
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "artisan" is not defined"
"php artisan" also doesn't work
All the answer in the web I have already tried to resolve my problems but nothing worked for me
Please, tell me, how can I install Laravel correctly and use it without errors
Run composer install or composer update. This will create the vendor folder and download all the dependent modules as mentioned in the composer.json
I want to add some more details which are asked but not clearly answered.
You did not install the composer dependencies. Try composer install.
It is not composer artisan. If you execute that command, you say hey composer! run your artisan command. And it says "Command "artisan" is not defined."
It is php artisan. But if you don't run composer install, php artisan will not work either. Because you are missing Symfony Console Component in your project (not the one used by composer) as well as a complete Laravel installation. Both will also be installed by the composer install command.
Well. I've solved my problem. As I mentioned before I had tried all the answer in the web but nothing had helped me. So then I just deleted my laravel project and ran this command
sudo apt-get upgrade
After some time packages were upgraded and I created new Laravel project. And Laravel started working perfectly! So in any incomprehensible situation do apt-get upgrade :))
Normally I do install Laravel 5.1 by following this command regarding to documentation:
composer create-project laravel/laravel --prefer-dist
It works fine.
But I read in the documentation under "Via Laravel Installer" also it is possible to install via Laravel Installer, which is much faster than installing via Composer:
laravel new blog
But to use this method I need to run following command once:
composer global require "laravel/installer=~1.1"
When I do run it I get following errors many times
Deprecation Notice: Composer\Package\Version\VersionParser::parseLinks
is deprecated. Use \Composer\Package\Loader\ArrayLoader::parseLinks()
instead in
phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Package/Version/VersionParser.php:226
after many line of same error ./composer.json has been updated appears and it continues with the same line of errors, it ends with following
Loading composer repositories with package information Updating
dependencies (including require-dev) Nothing to install or update
Generating autoload files
What is wrong with it? Any idea or solution.
My environment: Windows 10, GitBash and cmder console.
Update of composer, I did ran composer self-update also
Snapshot of console
EDIT:
Note, I can confirm after solving the issue that the installation via Laravel Installer method is faster than composer.
The Composer Assets Plugin you've installed locally is using a deprecated method of Composer. The plugin is already fixed, so run composer global update to get the latest versions with the bug fix. After it, you should be able to run the command succesfully.
If this doesn't work (as you might get the same error running the previous command), try removing the global vendor directory. When running any global Composer command, it outputs something like "Changed current directory to XXX". Remove the XXX/vendor directory and then try running the command.
In addition to #WouterJ answer.
Worst case if the steps provided by #WouterJ did not work, you could manage to uninstall and reinstall composer for windows.
When done, run composer global update to be sure to get latest updates, if there was.
Then run composer global require "laravel/installer=~1.1" and it should works.
Remember to update your windows environment path C:\Users\UserName\AppData\Roaming\Composer\vendor\bin
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'm trying to install laravel via composer in a windows 8 machine.
I'm running the command "composer create-project laravel/laravel --prefer-dist" in an empty folder and I'm getting no output to that command even after waiting for several minutes (no output, neither an error)...
I've tried also changing laravel/laravel to some nonexistan package name like "laravel1234" waiting some kind of error or something but nothing changes. I've to cancel with Ctrl+C
Feel free to tell me if I can update my question with some other information, I think probably I'm doing something wrong. Should I put a composer.json file in the folder? I think that isn't necessary with this command.
Thank you very much.
The command was slightly wrong as #justrohu said, however I think the lack of output is probably due to network issues.
Try this to see where composer is getting stuck:
composer -vvv create-project laravel/laravel your-project-name --prefer-dist
Hi there the command you are running should be like
composer create-project laravel/laravel your-project-name --prefer-dist
it is mentioned in here http://laravel.com/docs/quick#installation
It is simply a bad/slow connection problem, I had this issue yesterday at home! I tried it again from work, it worked! However, joe niland's comment to run the create-project in verbose mode (-vvv) is super helpful because you will not think of it as stuck.. and you will see things moving even if slow! Good luck on your Laravel Journey!
P.S. the command that you've used in your question misses out the project name, however i'm not gonna comment on that because others have commented on that, plus in one of your replies, you've said that you had already tried that.