Connect SQL Server 2012 with PHP version 8.1.1 - php

I have added this 2 lines
extension=php_pdo_sqlsrv_81_ts_x64.dll
extension=php_sqlsrv_81_ts_x64.dll
inside my php.ini file and than I have added this 2 files inside in drivers too. It is not getting connected with SQL Server 2012 and PHP version which I am using is 8.1.6.
Any help will highly appreciated.
Error message:
call to undefined function sqlserv

Related

Connecting to MS SQL Server via XAMPP PHP undefined function sqlsrv_connect

I'm new to PHP (and web servers for that matter).
Here's what I'm dealing with.
Database Server: MS SQL Server 2014 Express
Web Server: XAMPP v3.2.2
PHP: PHP Version 7.3.0
I'm trying to connect to my database via PHP.
Here's what I've done thus far.
1) Since I need drivers for PHP Version 7.3.0, I got them at https://github.com/Microsoft/msphpsql/releases (Windows-7.3.zip)
There are four files in the folder.
2) I've placed all possible combinations of those files in C:\xampp\php\ext and added/deleted corresponding lines like "extension=php_pdo_sqlsrv_73_nts"
I don't know if it matters, but I placed all the lines just under all the other extensions (the last on the list is "extension=shmop").
3) Then I've proceeded to http://localhost/dashboard/phpinfo.php, but there was no changes on this page. And my connection attempt results in the same error:
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect()
Any help would be appreciated. Thank you!

SQL server error: Unable to connect to your database server using the provided settings

Again I am here with an error, i have connected my PHP with SQL server from an IP Address and it works properly in my local PC. but when i transfer my source codes to my client PC it gives below error:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: C:/xampp/htdocs/SAT_POS/system/database/DB_driver.php
Line Number: 436
but actualy i have included the extension also and set in php.ini, see below:
extension=php_sqlsrv_56_ts.dll
extension=php_sqlsrv_54_ts.dll
the above two lines are included in the php.ini file and the extension directory is also the default one, see below:
extension_dir="C:\xampp\php\ext"
and in CI database code I configured like below :
You have to pick ONE SQL Server database extension ONLY.
You have also loaded one extension that is compiled for PHP 5.4
php_sqlsrv_54_ts.dll
AND one that is compiled for PHP 5.6
php_sqlsrv_56_ts.dll
Pick the ONE extension that matches your currently runnning PHP version
Also did you load the SQLServer client software on your clients PC.
At last with the help of the stack genius who commented on this I have done the work!
Just installed ODBC DRIVER for SQL SERVER on the windows!

Enabling MSSQL Connection with PHP 5.6 for IIS 8.5 webserver

I'm facing a problem with enabling a mssql connection to the DB with PHP 5.6 on my IIS 8.5 webserver.
Starting point:
I'm migrating our "networkshareaccess-order-phptool" (Orders for acces on a networkshare for internal employees) from PHP 5.2/IIS 6.0/Windows Server 2003 to PHP 5.6/IIS 8.5/Windows Server 2012 R2. So far so good. I could finish the whole migration except the establishing of the connection to the MS SQL database.
I get the following fatal error:
Call to undefined function mssql_connect() in "Path" on line 144
The php code and the user/userpermissions in MS SQL are right. I added the php_sqlsrv_56_nts.dll in the PHP ext folder, enabled it in the extension section in the php.ini file and added the FastCGI to the Handler Mappings.
I read several threads about this topic but I couldn't solve the issue. When I check the phpinfo on the new server there's no mssql section.
Does someone know what the problem could be in this case?
BR

How to access remote SQL Server from PHP script [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
PHP Fatal error: Call to undefined function mssql_connect()
I am developing a light-weight PHP application which accesses a remote SQL server db.
So far, I am out of luck in getting connection setup to SQL Server db through my PHP script.
I keep getting this error when I am trying to connect to sql DB:
Fatal error: Call to undefined function mssql_connect()
I get similar error when I try sqlsrv_connect($myServer, $myUser, $myPass) too
Here is what I have already tried:
I search for solution on web for hours, but nothing works.
I downloaded drivers from http://www.microsoft.com/en-us/download/details.aspx?id=20098
and unzipped them into php/ext folder
modified php.ini to add newly downloaded drivers lines:
extension=php_sqlsrv_54_ts.dll
extension=php_pdo_sqlsrv_54_ts.dll
[sqlsrv]
sqlsrv.LogSubsystems = 1
sqlsrv.LogSeverity = 1
sqlsrv.WarningReturnAsErrors = 0
Restarted the Apache server
But, see phpinfo() output it doesn't have sqlserv in it http://bit.ly/TkMC6V
Just so you know, I am developing this on my windows machine by installing EasyPHP. This website will be deployed on a Unix box. I tried to connect sql server through php on both Windows and Unix machine without any success.
Version info:
SQL Server 9.0.5000
PHP ver 5.4.6
Apache 2.4
I just dont get sqlsrv in my phpinfo() as mentioned in this question PHP Fatal error: Call to undefined function mssql_connect()
Is there a different way to install the drivers, other than what I have outlined above?
Let me know if you need more info.
Thanks!
I found the issue, by looking at phpInfo() output carefully
Loaded Configuration File C:\Program Files (x86)\EasyPHP-12.1\apache\php.ini
I was modifying php.ini in php directory.
But, I needed to modify the one in apache directory
I can delete this silly question.
But, I think it might be helpful for someone facing similar issue.
Jeez , I spent 4 hour on this stupid issue. :)

"Call to undefined .. mssql_connect" when using PHP in IIS?

May is ask you about how to connect to Microsoft SQL server 2005 enterprise using PHP.
I am using Appserv 2.5.10 ( Apache 2.2.8, PHP 5.2.6) and SQL server 2005
After I place the extension download from this link :
http://www.microsoft.com/en-us/download/details.aspx?id=20098
enable the php.ini file by adding these lines.
extension=php_pdo.dll
extension=php_sqlsrv_52_ts_vc6.dll
extension=php_pdo_sqlsrv_52_ts_vc6.dll
Restart Apache using this code to connect
$link = mssql_connect($server, $user, $pass);
Error shown in browser is
Fatal error: Call to undefined function mssql_connect() in G:\AppServ\www\testmssql_connect.php on line 12
can anyone help me ?
NOTE: i am using windows server 2003 and i don't found this OS in OS supporting list of Microsoft Driver 3.0 for PHP. Is this issue cause the problem ?
Look at this link:
PHP Fatal error: Call to undefined function mssql_connect()
1) Check your PHP.INI file's extension_dir
2) Make sure you copied your .dlls into that directory (for example, into C:\PHP\ext").
3) Create a dummy page to call phpinfo();. Display the page in a browser. Make sure you see entries for "sqlsrv".
'Hope that helps!

Categories