Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Composer without ssh access to server

Tags:

Is it possible to run composer on a cheap webspace that can't be accessed using ssh, only ftp?

Running system('php composer.phar install'); should work in theory - is that the recommended method?

like image 867
Niko Sams Avatar asked Apr 12 '13 11:04

Niko Sams


People also ask

How do I use Composer locally?

This is the easiest way to get Composer set up on your machine. Download and run Composer-Setup.exe. It will install the latest Composer version and set up your PATH so that you can call composer from any directory in your command line. Note: Close your current terminal.

Do I need to install Composer on server?

yes, but it's not necessary to download vendors with composer install . you can move composer binary file to Server and move your vendor too, then place vendor folder on your project and use composer dump-autoload . 's that means we can't setup application without composer.


1 Answers

I think the best way, as suggested in the comments before, is to execute the composer step on a local system that is able to do it, and then upload the result via FTP.

Composer has some (probably optional) software dependencies that most likely will not be available on your webspace. For example it needs the Git and SVN client software in case the project you are about to install references such dependencies.

Another thing is that downloading from Github (or anywhere else) can fail. Or trigger the API limit and ask for a login.

You'd really want to collect all the software and know that it worked instead of hoping it will execute well remotely.

like image 199
Sven Avatar answered Sep 23 '22 22:09

Sven