Guzzle without composer

16,480

Solution 1

You shouldn't go for the manual installation of Sproutvideo, because that is more of a mess than you can think of. In fact, it won't get you around using Composer for installing Guzzle at all, as you found out.

When using shared hosting (and even when using dedicated servers with root access), it is a good idea to NOT call Composer on that machine to install dependencies. You should have a way to put your regular website's files on the shared host, maybe with FTP (warning: no password encryption! Avoid it), SFTP, SCP, FTPS, WebDAV etc. Whatever it is that you use to copy your files from a local machine to the shared host, you should use it to also copy the files that Composer downloaded for you.

That means you have to run Composer on that local machine. You install it and run the command needed to download the packages you need, and to create the autoloading. After that, you can upload the files to the shared host.

Depending on how you develop, uploading and then fiddling with the files on the shared host is entirely possible, but I'd recommend preparing a local development environment. That way you won't accidentally take your live site down when you put an error in your code and instantly upload it.

In order to use the classes that are autoloaded by Composer, you simply have to include the file that resides at vendor/autoload.php (if your PHP file is not in the root directory, you have to use the correct path, most likely prepend ../ one or more times). After this file is included, you simply use the classes. Note that you have to use the correct namespace for the Sproutvideo library.

One more thing: The Sproutvideo library currently has no released version, so the installation instructions on the Github page are effectively wrong, because you cannot address a released version. Take this as a warning sign. Additionally, this library depends on an outdated Guzzle version 3.7. The latest version in the 3.x series is 3.9.3, and it will only be maintained until the end of the year 2015 at the latest. This is an additional warning sign. You may want to contact the maintainer of Sproutvideo and ask to release a version and to update the dependency on Guzzle.

Solution 2

You can download a packaged version of Guzzle from this site, without requiring Composer to create the dependencies.

https://php-download.com/package/guzzlehttp/guzzle

Share:
16,480
al404IT
Author by

al404IT

Updated on June 10, 2022

Comments

  • al404IT
    al404IT almost 2 years

    I need to use sproutvideo php lib that requires Guzzle

    Guzzle needs composer to install and not sure if is needed to run, since in some file i found

    require 'vendor/autoload.php';
    

    i never used composer and i'm on shared hosting, where i can't install it

    i download Guzzle from github but not sure i solve the autoload.php staff and if is going to work

  • mufazmi
    mufazmi almost 4 years
    the php-download.com website is down.
  • RobIII
    RobIII almost 3 years
    Currently it tries to make you sign up and then also pay for it (proof)