Sorry, started a new thread because the old one maybe getting too confusing. Anyway, after I thought I fixed the issue by putting phpagi-asmanager.php in the /var/lib/asterisk/agi-bin, now I got new problem.
Here is the php file code:
#!/usr/bin/php -q
And I got:
PHP Notice: Undefined index: PATH in /var/lib/asterisk/agi-bin/phpagi.php on line 1693
PHP Notice: Undefined index: PATH in /var/lib/asterisk/agi-bin/phpagi.php on line 1693
in the debug CLI asterisk.
What is that mean?