Hey maracuchi,
What is the task you're trying to achieve here? AGI is simply a dynamic way of changing the flow of the dialplan. For example;
; No AGI
exten => 123,1,Answer()
exten => 123,n,Hangup()
The entry answers and hangups.
With AGI, we can do things a little differently.
; With AGI
exten => 123,1,Answer()
exten => 123,n,AGI(agi.agi)
And inside our AGI script we can hangup the channel. AGI can be anything you like...PHP like you said, Perl (my favourite and ViCi's favourite...as well as people in the Asterisk community), Python, any conceivable script really!
If you can tell us what you're trying to do we can help with your AGI scripts
Cheers.