PHP致命错误类未找到 - Composer

时间:2017-05-03 14:33:30

标签: php composer-php

我正在使用Composer设置一个项目,当我尝试运行它时,我在PHP错误日志中收到此错误:

  

PHP致命错误:未捕获错误:类   找不到'SocialConnect \ Common \ Http \ Client \ Curl'   /Applications/MAMP/htdocs/login-platform/index.php:3

这是目录结构:

.
├── composer.json
├── composer.lock
├── index.php
├── vendor
│   └── ...

索引文件到目前为止只有这个:

<?php

require __DIR__.'/vendor/autoload.php';

?>

这是composer.json:

{
  "require": {
    "socialconnect/auth": "^1.2"
  }
}

这是/vendor/socialconnect/common/composer.json:

{
"name": "socialconnect/common",
"description": "Common component",
"license": "MIT",
"authors": [
    {
        "name": "Dmitry Patsura",
        "email": "talk@dmtry.me"
    }
],
"require": {
    "php": ">=5.5",
    "ext-json": "*"
},
"require-dev": {
    "ext-curl": "*",
    "squizlabs/php_codesniffer": "^2.8",
    "phpunit/phpunit": "^4.2",
    "guzzlehttp/guzzle": "^5.3|^6.0",
    "doctrine/cache": "^1.5.1"
},
"suggest": {
    "ext-curl" : "Allows to use Http\\Client\\Curl",
    "guzzlehttp/guzzle" : "Allows to use Http\\Client\\Guzzle, require guzzlehttp/guzzle:~5.3|~6.0."
},
"autoload": {
    "psr-4": {
        "SocialConnect\\Common\\": "src/"
    }
}
}

我是作曲家的新手。 socialconnect文件夹位于供应商目录中。我该如何连接?

谢谢!

编辑:哈桑回答后收到的错误:

  

您的要求无法解析为可安装的软件包。

     

问题1        - 请求的包socialconnect / common ^ 1.1作为socialconnect / common存在[0.1.0,0.1.1,0.2.0,0.2.1,0.2.2,0.2.3,0.2.4,0.2.5,0.2.6 ,0.2.7,0.3.0,0.3.1,0.3.2,0.4,0.5,0.6.0,0.7,0.7.1,0.7.2,0.7.3,1.0.0,1.0.1,dev-master ]但这些被你的约束所拒绝。     问题2        - socialconnect / auth 1.2.2需要socialconnect / common ^ 1.0 - &gt;可以通过socialconnect / common [1.0.0,1.0.1]来满足,但这些与您的要求或最小稳定性相冲突。        - socialconnect / auth 1.2.1需要socialconnect / common ^ 1.0 - &gt;可以通过socialconnect / common [1.0.0,1.0.1]来满足,但这些与您的要求或最小稳定性相冲突。        - socialconnect / auth 1.2.0需要socialconnect / common ^ 1.0 - &gt;可以通过socialconnect / common [1.0.0,1.0.1]来满足,但这些与您的要求或最小稳定性相冲突。        - socialconnect / auth 1.2.2需要socialconnect / common ^ 1.0 - &gt;可以通过socialconnect / common [1.0.0,1.0.1]来满足,但这些与您的要求或最小稳定性相冲突。        - socialconnect / auth的安装请求^ 1.2 - &gt;可以通过socialconnect / auth [1.2.0,1.2.1,1.2.2]来满足。

0 个答案:

没有答案