Good morning. I am trying to set up a php development environment but I keep running in circles chasing down answers that have not worked by searching.
The error I get when trying to run the test php file in Php Designer or after saving it and running it in Chrome or Firefox to connect to my local MS SQL Express db is:
Fatal Error: Call to undefined function sqlsvr_connect()
I am using:
- Xampp Control Panel V3.2.2
- Apache 2.0 Handler
- PHP Version 7.2.5 (x86)
- MS SQL Express 2017 RTM
- Php Designer 8.1.2
What I think are the correct MS SQL drivers for PHP php_pdo_sqlsrv_72_ts_x86.dll and php_sqlsrv_72_ts_x86.dll Both are stored in C:\xampp\php\ext
The code I'm using in the test.php:
$serverName = "DESKTOP-1FK6JRL\\SQLEXPRESS"; //serverName\instanceName
$connectionInfo = array( "Database"=>"testdb", "UID"=>"myusername", "PWD"=>"MyPassword");
$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 my Apache error log:
[Sat Jun 02 11:00:31.829695 2018] [ssl:warn] [pid 11940:tid 672] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 02 11:00:31.910495 2018] [core:warn] [pid 11940:tid 672] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat Jun 02 11:00:31.918467 2018] [ssl:warn] [pid 11940:tid 672] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 02 11:00:31.965356 2018] [mpm_winnt:notice] [pid 11940:tid 672] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5 configured -- resuming normal operations
[Sat Jun 02 11:00:31.965356 2018] [mpm_winnt:notice] [pid 11940:tid 672] AH00456: Apache Lounge VC15 Server built: Mar 28 2018 12:12:41
[Sat Jun 02 11:00:31.966316 2018] [core:notice] [pid 11940:tid 672] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sat Jun 02 11:00:31.972327 2018] [mpm_winnt:notice] [pid 11940:tid 672] AH00418: Parent: Created child process 22396
[Sat Jun 02 11:00:32.801001 2018] [ssl:warn] [pid 22396:tid 744] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 02 11:00:32.873530 2018] [ssl:warn] [pid 22396:tid 744] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 02 11:00:32.921373 2018] [mpm_winnt:notice] [pid 22396:tid 744] AH00354: Child: Starting 150 worker threads.
Here is my php.ini with the extension_dir set to extension_dir="C:\xampp\php\ext"
extension=bz2
extension=curl
extension=fileinfo
extension=gd2
extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=interbase
;extension=ldap
;extension=mbstring
;extension=exif ; Must be after mbstring as it depends on it
;extension=mysqli
;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
extension=php_pdo_sqlsrv_72_ts_x86
extension=php_sqlsrv_72_ts_x86
;extension=php_pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop
Any help that anyone can give would be GREATLY appreciated. I have tried all types of combinations to no avail.