AGI Maximum execution time exceeded in PHP


exten => 300,1,AGI(/var/www/html/agiscript.php, ${variable})
exten => 300,1,Hangup

Tested many examples, including the of web site of AGI PHP

But always say

#!/usr/bin/php -q
Fatal Error> Maximum execution time of 90 seconds exceeded in /var/lib/asterisk/agi-bin/phpagi-2.14/phpagi.php on line 186

I verified the path to PHP the which is /usr/bin/php

Why is Maximum execution time exceeded ?

Look in your php.ini file for the parameter “max_execution_time” and change its value.

Sorry, didn’t read everything…seems the AGI script doesn’t receive any response from the Asterisk server, is your Asterisk server reachble ? Is there a firewall blocking the 5038 port ? Also check the AMI configuration in manager.conf.


Marco Bruni

Hi, i check my manager.conf and the port 5038 is listening. I have installed trixbox and i have configured the IVR the wich i after disabled, all the calls inbound are getting in one extension, the which I can take the calls but not the variables

This is my script php

#!/usr/cgi-bin/php -q

<?php require "/var/lib/asterisk/agi-bin/phpagi-2.14/phpagi.php"; $agi = new AGI(); $agi->answer(); $mivar=$agi->get_variable("variable"); echo $mivar; ?>