所以...我正在使用带有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();
知道为什么不加载课程?
所有文件都在应用程序/供应商
中答案 0 :(得分:0)
忘记将stomp扩展名加载到php.ini文件@ cPanel中。 可以在此处找到扩展程序:https://pecl.php.net/package/stomp