【问题标题】:CodeIgniter Stomp not found using composer使用作曲家找不到 CodeIgniter Stomp
【发布时间】:2017-02-16 21:00:36
【问题描述】:

所以...我在 PHP7.0 中使用 codeigniter3,因为这是与 stomp v2.0.0 @pecl 兼容的版本...一切都应该井井有条。

我已经在application/config.php中设置了

$config['composer_autoload'] = TRUE;

在 composer.json 中

{
    "name": "gritnet/gms",
    "description": "GMS is a basic content management system based on CodeIgniter with the sole purpose of helping in the development of small to medium custom websites",
    "type": "project",
    "require": {
        "rmccue/requests": "^1.7",
    "stomp-php/stomp-php": "4.*"
    },
    "authors": [
        {
            "name": "GRITNET LIMITED",
            "email": "office@gritnet.uk"
        }
    ]
}

在运行命令composer install我得到

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

在运行命令composer update我得到

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

当我尝试使用通过 composer 安装的库连接到服务器时,出现以下错误:

An uncaught Exception was encountered

Type: Error

Message: Call to undefined method Stomp::connect()

Filename: /home/gritnet/public_html/gms/application/controllers/Homepage.php

Line Number: 11

第 11 行是

        Line 10: $stomp = new Stomp('tcp://localhost:61613');
        Line 11: $stomp->connect();

知道为什么不加载类吗?

所有文件都在application/vendor

【问题讨论】:

    标签: php codeigniter composer-php stomp


    【解决方案1】:

    忘记将 stomp 扩展加载到 php.ini 文件 @cPanel。 扩展可以在这里找到:https://pecl.php.net/package/stomp

    【讨论】:

      猜你喜欢
      • 2018-04-05
      • 2015-11-27
      • 2017-02-06
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      • 2016-03-05
      • 2016-02-29
      • 2016-01-10
      相关资源
      最近更新 更多