working - vendor/autoload.php download




How do I install Composer PHP packages without Composer? (4)

I'm trying to install the Coinbase PHP API but it requires Composer:

https://github.com/coinbase/coinbase-php

I'm looking for a universal PHP solution (perhaps a function) to let me install composer packages directly onto my server, without having to use Composer.

I think the developers of Composer believe they are helping people, but actually there are thousands of beginner developers that are being locked out of learning web development by the 'Composer barrier'.

It would really help if there was a flexible solution or some approach where we could install without Composer? How can I do this?

Please don't respond with some sarcastic comment . There are people that don't want to use Composer and I don't see why we should be herded into a specific third-party software in order to do web development.


I had to do this for an FTP server I didn't have SSH access to. The site listed in here worked, then I realized you can just do a composer install on your own server (using your target's PHP version), then copy all the files over.


I'm using shared hosting for a website and can't execute commands there. Aside from running composer via php script request that I request via browser, I usually use this workflow:

  • Make sure you have php installed locally.
  • Make directory on desktop.
  • download composer.phar from https://getcomposer.org/download/ (under header *Manual Download ) and place it in the directory.
  • make a file composer.json paste in it the following contents

     {
         "require": {
             "coinbase/coinbase": "~2.0"
         }
     }
  • Browse to the directory with the shell of your choice(bash, git-bash, cmd, windows bash)

  • type php composer.phar update
  • Upload the vendor directory to your webserver via ftp or whatever mechanic you use.
  • include in your php project where you load your libraries(modify path to where you uploaded the vendor dir so it will include that autoload file)

    require_once('vendor/autoload.php');

This way you get the benefit of dependency management and you don't have to include manually all the gazillion of files and download all the dependencies manually, and updating them is just as easy as typing php composer.phar update and then replacing the vendor dir on your server with the new one.


This is not the ultimate solution but for me it was a big help for most of the cases: https://github.com/Wilkins/composer-file-loader

Allow you to load composer.json file just as composer would do it. This allow you to load composer.json file without composer (so theorically PHP 5.2 is enough)

I know the question is old but I hope it will help someone.


You can try https://php-download.com/ which can help you download all dependency most of the time along with vendor folder. It promises composer not required. Tried it myself. It finds and creates all required folders and zips it for download. Works perfectly !!





composer-php