Asterisk PHPAGI问题

I'm using PHPAGI which I've used countless times before. However, it doesnt appear to be behaving on my new test server.

When I try wait_for_digit, it immediately returns and the Asterisk CLI shows

WARNING[11873][C-00000000]: channel.c:3660 ast_waitfordigit_full: The FD we were waiting for has something waiting. Waitfordigit returning numeric 1

Here is my php code:

#!/usr/bin/php
<?php
require 'phpagi.php';

$agi = new AGI();

$test = $agi->wait_for_digit(); //lets try to simply get asterisk to wait. 

?>

and my dialplan

exten => 123,1,Answer()
exten => 123,n,AGI(/var/lib/asterisk/agi-bin/voicemail.php,test,1)