sql server - PHP: Connect to MSSQL database with IPv6 -
using php (with dblib driver), trying connect mssql server ipv6 address. code looks this:
<?php $db_host = 'ff3e:30:fd66:98:5837::'; $db_port = '1433'; $db_name = 'thedb'; $db_user = 'theuser'; $db_pass = 'thepass'; $conn = new pdo("dblib:host=$db_host:$db_port;dbname=$db_name", $db_user, $db_pass); $conn->setattribute( pdo::attr_errmode, pdo::errmode_exception ); $conn = null;
running php check.php
returns [err] sqlstate[hy000] unknown host machine name (severity 2)
, though host , port 100% correct , there no firewall issue, since can nmap
it:
$ nmap -6 -pn -p 1433 ff3e:30:fd66:98:5837:: starting nmap 6.00 ( http://nmap.org ) @ 2016-02-05 16:50 cet nmap scan report <hostname> (ff3e:30:fd66:98:5837::) host (0.0019s latency). port state service 1433/tcp open ms-sql-s
why doesen't work? ipv6 issue?
if helpful, executing pdo::getavailabledrivers()
results in
array ( [0] => dblib [1] => mysql )
Comments
Post a Comment