[solved] PHP AGI MySQL

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());
}

?>

This appears to be a PHP <-> MySQL issue and not an Asterisk one. Better off posting on a PHP/MySQL forum.

Yes, that is true. But I know a lot of the folks here use this environment and thought I might get lucky.

I got this resolved. The issue is that I am using MySQL 5.X and apparently PHP-4.X.X uses a MySQL 4.X type of password mechanism which is incompatible. I stored my passwords in the MySQL schema as 4.X type passwords. Here is the command to do that if anyone is interested.

mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd')