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 MATLAB怎么通过柱坐标变换画开口是圆形的旋转抛物面?
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿