For AGI Working in PHP we need PHP in CLI or CGI?

hi,
this may be a silly question but to be honest I dont know this
I am having issue when I call the php based AGI Script it says that no such file or directory but in the same dialplan When I call perl script it is working fine
both the agi scripts reside in var/lib/asterisk/agi-bin
I am not sure but that I have doubt on PHP being as CGI or CLI Issue.

regards
Numan

post here the result of

the out is it shows all the script which reside in the agi-bin directory
and the script input.php is shown as follow

[color=green]-rwxrwxrwx 1 asterisk asterisk 347 May 27 2005 /var/lib/asterisk/agi-bin/input.php [/color]

no idea then :confused:
did you read this? voip-info.org/wiki/view/Asterisk+AGI+php