cant install laravel in composer [duplicate] - laravel

This question already has answers here:
Composer cannot download files
(3 answers)
Closed 3 months ago.
Tried creating a new project on a corporate proxy and suddenly composer cant create a laravel project.
"curl error 28 while downloading https://repo.packagist.org/packages.json: Connection timed out after 10001 millisec
onds"
been trying different stackoverflow solutions but none of them solves my problem.
running "composer diagnose"

hello you can try this,
Try clearing Composer's cache by running composer clear-cache remove composer.lock and composer install

Fixed the problem by running
SET HTTP_PROXY=http://username:password#IP:port && php composer.phar install
source:
Composer cannot download files

Related

how to fix error laravel 5.2 "failed to open stream: No such file or directory" without composer

I've got this error in my laravel 5.2 project who hosted in debian linux
Warning: require_once(/home/u706561288/public_html/sap/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
Fatal error: require_once(): Failed opening required '/home/u706561288/public_html/sap/vendor/composer/autoload_real.php' (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
so many forum like stackoverflow tell me to using php artisan "composer update" but
unfortunately my hosting package not available to composer instalation
please tell me how to fix this problem
I suggest that you test these steps
On the Localhost, run these two commands (composer update and composer dump-autoload)
Re-upload the entire project on the server
Also, if the problem is not resolved, you can delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again.
When the hosting service or some PC does not allow to install Composer and appears error like in my case, follow these steps:
Delete all laravel project in hosting service. I recommend to use smartftp for good speed file access and tracked action.
Back to our localhost project and run composer install --no-scripts command and then composer clearcache.
Reupload all laravel project.
Don't forget to configure .env file.
I hope this can help with the same problem in future.
I had the same error while back, what I did to solve it was. I delete all the vendor folder from the root project then install it back by executing composer install
delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again
this helped me
If anyone still facing the issue after deleting the vendor directory and did composer install try to update your composer by composer selfupdate then do the same install process.

Cannot install Laravel correctly

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 :))

Laravel Composer Update Error - Permission Denied

I'm having error during updating composer. It's a Laravel 4 project which I've downloaded from .... and first time I updated it, it was fine and got updated. but due some reason I deleted that replace it with a fresh copy of that project, but now when I started to update it, it gives me the following error:
[ErrorException]
copy(/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee6
2cb0fdf5ad970e7777912ef4722f.zip): failed to open stream: Permission denied
In between first and second update of this composer I did the following:
Tried to installed Vagrant and homestead, but failed due to some internet connection problem.
Updated Composer failed
Uninstalled vagrant and reinstall composer.
Reinstalled Composer
Updated composer (success)
Tried to install vagrant and homestead (success)
Update composer (failed)
uninstalled vagrant
Reinstalled Composer
Update Composer (failed)
The above mentioned error is getting occured again and again. I also tried 'composer clearcache' but doesn't worked. One thing which I noticed that it's been 16-19 months I'm using composer and never heard of such errors, but since I tried to install vagrant it created hurdles and errors for me.
I'm using Ubuntu 15.04
Updating Laravel 4.0 project
Updating Laravel 5
both project got updated before installing vagrant and homestead, but not now.
/var/www is under the group of 'www-data' and 'username' also the part of this group.
Any help plz!!!!!!!!!!!!!!!
I found the solution. If you see the error then it would be clear that I don't had access to the:
"/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee62cb0fdf5ad970e7777912ef4722f.zip".
When I explore this directory, I found that its owner is 'root' or 'sudo'.
So I deleted the '.composer' directory and then started to update in my laravel project directory, every thing was fine and perfect! No problem at all!
sudo composer update
worked for me. it's a permission issue.
if it doesn't work then you can try to
delete '.composer' directory and composer update afterward.
I know its an old topic, but for mac users this might be useful, since commands in macOS are a little bit different from linux distros and I had a hard time figuring this out.
cd into ~ directory
sudo chmod -R 777 .composer
Done. Now you can install/update composer.
I had the same issue with a mac, Composer warn me about running commands with super user permissions, so I've just changed the owner of files directory in the repo /Users/MyUserName/.composer/cache like so:
sudo chown -R MyUserName files/
Hope this helps.
I just run sudo before an all when ok
sudo composer create-project laravel/laravel=5.3 /Users/peter/Sites/blog --prefer-dist

Install Laravel behind proxy

Im trying to install Laravel on a windows machine.
I followed this guide up to point 11.
http://www.wikihow.com/Install-Laravel-Framework-in-Windows
I also ran two commands already (which I got from https://stackoverflow.com/a/18852026/2240163)
set http_proxy=<your_http_proxy:proxy_port>
set https_proxy=<your_https_proxy:proxy_port>
But on running composer install i am met with a message
C:\wamp\www\LARAVEL>composer install
Loading composer repositories with package information
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: SSL
: The specified procedure could not be found.
failed to open stream: Cannot connect to HTTPS server through proxy
How can I get past the proxy to install Laravel 4.
.
.
Here in lay the solution
C:\wamp\www\LARAVEL>set http_proxy=http://mnel:******#192.168.20.4:8080
C:\wamp\www\LARAVEL>set https_proxy=https://mnel:******#192.168.20.4:8080
I then ran the install composer command again and presto!
https://stackoverflow.com/a/24958700/2240163
Thanks #mneute
Here in lay the solution
C:\wamp\www\LARAVEL>set http_proxy=http://mnel:******#192.168.20.4:8080
C:\wamp\www\LARAVEL>set https_proxy=https://mnel:******#192.168.20.4:8080
I then ran the install composer command again and presto!
https://stackoverflow.com/a/24958700/2240163
Thanks #mneute
I got this same issue when I ran composer -vvv install. I did it in windows7 computer behind a company firewall. I search and tried every possible answer but didn't work. Then I tried following and it did work
https://www.calazan.com/how-to-set-the-proxy-settings-in-windows-via-command-line/

Unable to install Laravel 4 in linux using composer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
i am not able to install L4 on linux(ubuntu) with (PHP 5.4.9-4ubuntu2.2) using composer, below is the error screen shot, i update composer, even installed new composer still getting same error, it's working fine in windows
Solved
Thanks you all for your inputs and sorry for bothering, the problem is with our firewall it was
blocking swiftmailer/swiftmailer package url on linux box which was
causing this issue, and confusion is due to composer's wrong message, I think its verifying signature but not URL or domain
when i used curl to open the url then i found that our firewall is blocking the URL and redirecting to an internal error url see below screen shot
Try installing it with --prefer-source or --prefer-dist
php composer.phar create-project laravel/laravel --prefer-dist
or
php composer.phar create-project laravel/laravel --prefer-source
First install composer globally using terminal,
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Then install latest laravel from downloaded version.
First download and extract latest framework from Github
Then in terminal change your directory to project root folder, like
cd /var/www/laravel-master/
Or
cd /opt/lampp/htdocs/laravel-master
Then run composer installation,
composer install
If you are getting some timeout error use,
COMPOSER_PROCESS_TIMEOUT=24000 composer install
Or
COMPOSER_PROCESS_TIMEOUT=24000 composer update
Something to try would be to delete the composer cache located at ~/.composer/cache/. This will force composer to download all packages again instead of using what you have in cache. If there was an error when getting Swiftmailer the first time, it will continually try to pull that bad copy.
Also, try deleting your vendor directory in your project and running composer install again.

Resources