J'arrive a me connecter avec le code suivant (copier sur le site officiel de PHP):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?php
$serverName = "AMISSAH-PC\SQLEXPRESS"; //serverName\instanceName
// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array( "Database"=>"epayzone");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?> |
Mais avec Symfony3 :
1 2 3 4 5 6 7 8 9 10 11 12 13
|
parameters:
database_driver: pdo_sqlsrv
database_host: AMISSAH-PC\SQLEXPRESS
database_port: 1433
database_name: epayzone
database_user: null
database_password: null
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: ThisTokenIsNotSoSecretChangeIt |
J'obtiens l'erreur suivant:
ConnectionException in AbstractMySQLDriver.php line 103: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known.
Partager