I need to use AGI with PHP & MySQL. It seems that AGI likes PHP version 4.4.4, but not PHP version 5.1.6. when running the script below with version 5.1.6, it runs just fine but when I try it using PHP 4.4.4, I get the error below. I ran configure on both versions of PHP with “–with-mysql.” Any ideas?
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /var/lib/asterisk/agi-bin/my_test.agi on line 6
No connection: Client does not support authentication protocol requested by server; consider upgrading MySQL client
The entire script is as follows:
#!/usr/bin/php --q
<?php
include('db_login.php');
$connection=mysql_connect($db_host, $db_username, $db_password);
if (!$connection){
die ("No connection: ".mysql_error());
}
?>