Failed to install adm class with requirement (vendor / autoload.php error on centos6.5 / php5.4

I know many users have asked the same question before, but it didn't help me ... I have a VPS (centOS6.5 / directadmin / php5.4 / SSH terminal)

I'm trying to install myself ( https://imagine.readthedocs.org ) a class on 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 ran it:

composer update

      

OK! everything seems to be fixed!

Now at the root of my site, I want to test it:

<?php
require 'vendor/autoload.php'; // line 2
$imagine = new Imagine\Gd\Imagine();   // line 3



?>

      

But I am getting 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 to open "vendor / autoload.php" (include_path = '.: / Usr / local / php54 / lib / php') in /home/admin/domains/example.com/public_html/ info.php on line 2

// EDIT

Real localization of autoload.php on my server:

/usr/local/bin/vendor/autoload.php

      

There is also a "Submit" directory in the supplier directory!

+3


source to share


2 answers


/usr/local/bin

your binary file is located. You have to move composer.phar

to that location (and rename it to composer

) and then use composer

on the command line.



The file composer.json

is part of your package, it defines the packages it depends on in this file. Then you can install all required packages for the current package using composer install

/ composer update

. This will make a directory vendor

with all third party code and a preconfigured autoloader in vendor/autoload.php

.

+1


source


Finaly after install imagine class, I moved composer to root of my site and now it works fine



0


source







All Articles