I know many users have asked same question before but it wasn't helpful for me... I have a VPS (centOS6.5/directadmin/php5.4/SSH terminal)
I try install imagine (https://imagine.readthedocs.org) class in my server via getcomposer.org
These are my all steps:
First I install getcomposer:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
then:
cd /usr/local/bin/
And
echo '{"require": {"imagine/imagine": "~0.6.2"}}'->composer.json
After That I run it:
composer update
OK! everything seems installed!
Now in my website root, I want to test it:
<?php
require 'vendor/autoload.php'; // line 2
$imagine = new Imagine\Gd\Imagine(); // line 3
?>
But I get this error:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /home/admin/domains/example.com/public_html/info.php on line 2
Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/local/php54/lib/php') in /home/admin/domains/example.com/public_html/info.php on line 2
//EDIT
The real locate of autoload.php in my server:
/usr/local/bin/vendor/autoload.php
Also There "imagine" directory in vendor directory!
/usr/local/bin
is where your binary files live. You should movecomposer.phar
to this location (and rename it tocomposer
) and then usecomposer
in your command line.The
composer.json
file is part of your package, it specifies the packages it depends on in this file. You then can install all required packages for the current package by usingcomposer install
/composer update
. This will make avendor
directory with all third party code and a preconfigured autoloader invendor/autoload.php
.