5

I'm wondering how I would be able to load PHP packages without using composer to do so.

I'm unable to use composer as I'm using shared hosting, which imposes limitations like being unable to install composer due to a heavily jailed shell.

While there are certain packages which allow for the loading of a package with require_once('package/Autoloader.php');, i.e. Braintree & Twig.

However, not all packages can be loaded like this, example being, Pug-PHP, which only includes installation with composer.

Can anyone help me load composer packages without composer?

8
  • can you run php command ? at your server. may be like this /user/bin/php5 test.php Commented Oct 22, 2016 at 9:08
  • Yes, I am able to use the php command.
    – user5201343
    Commented Oct 22, 2016 at 9:25
  • check this command line installation : getcomposer.org/download Commented Oct 22, 2016 at 9:34
  • run given command. Commented Oct 22, 2016 at 9:36
  • 3
    Do you need to install them or just make them work on production environment ? Because in the latter case copying vendor folder directly to hosting will work. Commented Oct 22, 2016 at 12:11

2 Answers 2

0

This is not possible due to Packages being a dependency of the composer management system. Replicate the ENV locally and use @MichalGallovic 's suggestion.

There is also the option of git clone every package and dependency from their respective source repos; but at that point you will hate yourself.

Is the option of using a host that are not as strict an option?

0

Visit https://php-download.com/ They have a number of packages ready to go that will no longer need Composer. It finds and creates all required folders and creates a zips it for download. Saves me hours of drama.

1
  • 3
    needs paid subscription
    – MartinM
    Commented Mar 29, 2022 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.