I have the following difficulty: I need to configure the PHP environment to connect to a Sybase 16 base. I am not a PHP programmer and I am helping another colleague. Everything that has been tried so far does not work.
The code is:
$connection= new PDO ("dblib:version=4.2;charset=UTF-8;host=".$host.":".$port.";dbname=".$dbname, $username, $password);
and we get the error:
SQLSTATE[01002] Adaptive Server connection failed (severity 9)
Is there any tutorial for this? Everything I find is either for PHP 5 or is for Windows.
More information:
PHP Version 7.0.26-1~dotdeb+8.2
System Linux websrv01 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php/7.0/apache2
Loaded Configuration File /etc/php/7.0/apache2/php.ini
UPDATE:
Following the suggestions, we change the code this way:
$connection = new PDO("dblib:version=8;charset=UTF-8;host=".$host.":".$port.";dbname=".$dbname, $username, $password);
What resulted in:
« SQLSTATE[] (null) (severity 0) »
Another attempt was to use:
$connection = new PDO("sybase:host=".$host.":".$port.";dbname=".$dbname, $username, $password);
that continues with the error:
« could not find driver »
The drivers have been installed, but I know that PHP requires a configuration in your INI that I'm not sure how to do.