No title

I need to use sproutvideo php lib which requires Guzzle

Guzzle needs a linker to install and not sure if it is needed to run as in some file I found

require 'vendor/autoload.php';

      

I have never used composer and I am on shared hosting where I cannot install it

i download Guzzle from github but not sure if I solve autoload.php state and if it will work

+3


source to share


3 answers


You shouldn't go for the manual Sproutvideo installation because it's more of a mess than you might imagine. In fact, it won't help you use Composer to install Guzzle at all, as you found out.

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

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



Depending on how you develop, downloading and then playing files on a shared host is perfectly possible, but I would recommend preparing a local development environment. This way you won't accidentally delete your live site when you put a bug in your code and load it instantly.

To use the classes that are automatically loaded by Composer, you just need to include the file that is in vendor/autoload.php

(if your PHP file is not in the root directory, you must use the correct path, most likely prepend ../

one or more times). Once this file is included, you simply use the classes. Please note that you must use the correct namespace for the Sproutvideo library.

One more thing: the Sproutvideo library does not currently have a released version, so the installation instructions on the Github page are not that effective because you cannot target a released version. Take this as a warning sign. In addition, this library depends on the outdated Guzzle version 3.7. The last version in the 3.x series is 3.9.3 and it will only be supported until the end of 2015. This is an additional warning sign. You can contact the Sproutvideo maintainer and request a version release and update the dependency on Guzzle .

+1


source


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



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

+4


source


I was looking for a way to install Guzzle without Composer (I'm going to set it up on a production server and should keep new installations to a minimum). Guzzle 3.x can be installed via PEAR:

https://guzzle3.readthedocs.org/getting-started/installation.html

3.x is an old version, but I guess it's good for many uses.

If you are using RedHat or Centos, there is a package in the EPEL repository called "php-guzzle-Guzzle" that can be installed via yum. If you do, the way to include Guzzle in your php code is as follows:

<?php
require "Guzzle/autoload.php";

      

0


source







All Articles