简体   繁体   中英

Cannot redeclare class AGI_AsteriskManager

We downloaded latest phpagi 2.2. But when we are excuting our php file we are getting this error.

Cannot redeclare class AGI_AsteriskManager in /var/lib/asterisk/agi-bin/phpagi-asmanager.php on line 867

Here is our php file code

#!/usr/bin/php -q
<?php
 //set_time_limit(30);
 error_reporting(E_ALL);
 require('phpagi.php');


 $agi = new AGI();
 // $agi->answer();
 $agi->say_number("1234"); // speaks the number 1234 
 $agi->say_digits("1234"); // speaks the digits 1, 2, 3 and 4. 
 //$cid = $agi->parse_callerid();
 $agi->text2wav("Hello");
 $agi->text2wav('Goodbye');
 // $agi->hangup();
?>

将require('phpagi.php')更改为require_once('phpagi.php')

Give complete path for phpagi.php file if its not in agi-bin folder

require_once "/path/to/phpagi.php";

And also make sure that phpagi-asmanager.php is in same folder where your phpagi.php is placed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM