Good day I want to host my website that is written in php in IIS I have already installed php on my server and added the dll file but I'm still getting the HTTP 500 error when loading the website.
I'm using the following:
php 5.6.20 in my php.ini file I added
extension=php_sqlsrv_56_nts.dll
extension=php_pdo_sqlsrv_56_nts.dll
extension=pphp_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll
and added the dll files in my ext folder and restarted the server
I want to query a database from the server this is my connection to the database:
$servername = "TEST\TEST08";
$username = "Admin";
$password = "admin";
try {$conn = new PDO("sqlsrv:server=$servername;Database=My_Db",
$username,$password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}
$getdrop = conn->prepare($myQ);
$getdrop->execute();
please assist
I have the logs and I got the following errors in my logfiles:
[10-May-2016 10:54:42 Europe/Minsk] PHP Notice: Undefined variable: conn in C:\test\index.php on line 43
[10-May-2016 10:54:42 Europe/Minsk] PHP Fatal error: Call to a member function prepare() on null in C:\test\index.php on line 43
[10-May-2016 10:54:43 Europe/Minsk] PHP Notice: Undefined variable: conn in C:\test\index.php on line 43
[10-May-2016 10:54:43 Europe/Minsk] PHP Fatal error: Call to a member function prepare() on null in C:\test\index.php on line 43