douzhang7184 2017-02-16 21:00
浏览 121
已采纳

使用composer找不到CodeIgniter Stomp

So ... i'm using codeigniter3 with PHP7.0 because this is the compatible version with stomp v2.0.0 @ pecl ... everything should be in order.

I have set in application/config.php

$config['composer_autoload'] = TRUE;

In 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"
        }
    ]
}

On running command composer install i get

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

On running command composer update i get

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

When I try to connect to the server with the library I installed via composer I get the following error:

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

Line 11 is

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

Any idea why is not loading the class?

All the files are in application/vendor

  • 写回答

1条回答 默认 最新

  • dongqie4402 2017-02-22 17:54
    关注

    Forgot to load stomp extension into php.ini file @ cPanel. Extension can be found here: https://pecl.php.net/package/stomp

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 网络科学导论,网络控制
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)