Php 帕米可以';我找不到课
我正在尝试安装 我通过pear安装了它:Php 帕米可以';我找不到课,php,debian,asterisk,asteriskami,Php,Debian,Asterisk,Asteriskami,我正在尝试安装 我通过pear安装了它: # pear channel-discover pear.marcelog.name # pear install marcelog/PAMI 并尝试使用example.php $pamiClientOptions = array( 'host' => '127.0.0.1', 'scheme' => 'tcp://', 'port' => 9999, 'user
# pear channel-discover pear.marcelog.name
# pear install marcelog/PAMI
并尝试使用example.php
$pamiClientOptions = array(
'host' => '127.0.0.1',
'scheme' => 'tcp://',
'port' => 9999,
'username' => 'admin',
'secret' => 'mysecret',
'connect_timeout' => 10000,
'read_timeout' => 10000
);
use PAMI\Client\Impl\ClientImpl as PamiClient;
$pamiClient = new PamiClient($pamiClientOptions);
// Open the connection
$pamiClient->open();
// Close the connection
$pamiClient->close();
当我尝试使用此脚本时,收到错误:
Class 'PAMI\Client\Impl\ClientImpl' not found
这是第一次,我看到像这样包含类(使用)。
我也在使用DebianLinux。请帮忙
更新
它还安装在/usr/share/php/PAMI/中。我在这方面找到了解决办法 安装pear后,您必须执行此操作
require_once '/usr/share/php/PAMI/Autoloader/Autoloader.php';
PAMI\Autoloader\Autoloader::register();
我把这两个字符串放在脚本的顶部,现在就可以了。但它也收到了奇怪的消息
PHP Fatal error: Class 'Logger' not found in
我通过安装Log4HP解决了这个问题:
$ pear channel-discover pear.apache.org/log4php
$ pear install pear.apache.org/log4php/Apache_log4php-2.1.0
而且你应该在第一次要求之前放一次-
require_once '/usr/share/php/log4php/Logger.php';