Search code examples
phpinstallationphrets

How To Install PHRets 2.0 Without Composer?


After struggling with my webhost for almost a month, they've finally just told me they don't support Composer. I still want to use PHRets. Is it possible to install and/or use PHRets without Composer?


Solution

  • If you're unable to use Composer on a server, you should still be able to install Composer locally and run it to populate your vendor/ directory. With that populated, you can simply copy/FTP that to the server and you should be fine.

    Installing Composer packages from a machine other than the one that the code will run on has a few risks but is usually OK. For example, if a certain package requires PHP 7+ which you have installed locally but your server only runs PHP 5.6, Composer may gather the PHP 7+ dependencies just fine, but you'd run into problems loading those on your server (whereas if you ran Composer on that server, you'd get errors or earlier versions that didn't require PHP 7+ that still satisfied your defined requirements).

    There are no plans for PHRETS to include it's own autoload option simply because of the other PHP libraries it depends on. Having to gather PHRETS, Guzzle, some Illuminate packages, etc. and put them all together in a way that doesn't involve Composer and still works is an incredible amount of work.