zoumhs, run command line on your home pc and enter (telnet <IP address of your dedicated server> <port SQL Server>)
if after entering the telnet command a blank black screen appears, then the port was opened correctly
Посмотреть вложение 38725
otherwise check your firewall settings / settings SQL Server Configuration manager
to check the connection to the remote database from the site.
create file dbtest.php at site root and execute it (enter in browser domain.com/dbtest.php)
PHP:
<?php
$availableDrivers = PDO::getAvailableDrivers();
$driver = 'sqlsrv';
if ( !in_array( $driver, $availableDrivers ) )
{
echo '<pre>Available drivers:<br>';
print_r( $availableDrivers );
echo '</pre>';
die( "Driver <b>$driver</b> not supported" );
}
$dbhost = '8.8.8.8';
$dbport = 1433;
$dbuser = 'sa';
$dbpass = '12345';
$dbname = 'lin2db';
try
{
$dbh = new \PDO( "$driver:Server=$dbhost,$dbport;Database=$dbname", $dbuser, $dbpass );
}
catch ( \PDOException $e )
{
die( $e->getMessage() );
}
echo 'Connected!';
?>
status code 500 - reason syntax error in php code and/or many other reasons