dpnof28482 2014-12-26 09:38
浏览 140

无法安装带有require的imag类(centos6.5 / php5.4上的vendor / autoload.php错误

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!

  • 写回答

2条回答 默认 最新

  • douqianbiao4216 2014-12-26 18:26
    关注

    /usr/local/bin is where your binary files live. You should move composer.phar to this location (and rename it to composer) and then use composer 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 using composer install/composer update. This will make a vendor directory with all third party code and a preconfigured autoloader in vendor/autoload.php.

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号