I have read a few of the posts regarding the PHP script not running correctly, but have not been able to determine the exact issue or cause that affects my problem. I have php 7.4.7, i have the SQL drivers installed for MS SQL Server, x64, thread safe. I am using Firefox and Chrome.
I can start Apache, open the Admin screen, open PHP Info to verify the drivers are listed.
The PHP file I want to open/execute is xampp/htdocs/phpCon/index.php. I type "localhost/phpCon/" into the browser, and I see all the PHP code starting with the database name.
This is the total code in "index.php":
- Code: Select all
<? php
$serverName = "TWCGIMDT01\SQLEXPRESS";
$connectionInfo = array( "Database"=>"MainDB");
$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));
}
?>
This is from the Apache access log when I open the index.php file:
- Code: Select all
::1 - - [25/Jun/2020:14:26:35 -0700] "GET /phpCon/ HTTP/1.1" 200 335 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0"
This are the last couple of entries to the Apache Error log:
- Code: Select all
[Thu Jun 25 14:24:42.494398 2020] [ssl:warn] [pid 55224:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 25 14:24:42.585401 2020] [ssl:warn] [pid 55224:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 25 14:24:42.635396 2020] [mpm_winnt:notice] [pid 55224:tid 552] AH00354: Child: Starting 150 worker threads.
I get the same results with Chrome.
I understand that it may not have anything to do with the browser, but rather Apache being able to run the PHP. Correct?
Where do I go from here?