简体   繁体   中英

Install Composer without curl (local)

I have to run a Laravel Project on a customers Server, Mcrypt is already installed but I can't run "composer install" because composer is missing. Problem here is, that I can't run

curl -sS https://getcomposer.org/installer | php

because I don't get a connection to other server "outside".

So does anybody know, if I can save the file local and upload it with FTP and run it? Already tried to save the /installer as a file and run it with "asdf | php" but it didn't work. I also downloaded the composer.phar file but how do I run the .phar file?

Thanks!!

Downloading the composer phar file as you have done is a sufficient alternative.

Usage:

php composer.phar command

Docs: https://getcomposer.org/doc/01-basic-usage.md


However, I am fairly sure composer depends on curl, at least as far as updating/installing packages goes. So if you're intending to use those features you'll need curl anyway.*

*citation needed.

edit :

I am currently looking through the composer source and I can't yet find a reference to curl. It appears to use stream_context_create, and the manual page for that method doesn't mention curl either. So maybe it'll work without curl...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM