my PHP Version is 5.6 and I ve already downloaded the driver for the sqlsrv extension and placed it in the ext/ directory, as well as modified the php.ini with the new extensions.
I still get the following error when trying to connect to my database
Fatal error: Call to undefined function sqlsrv_connect() in C:\inetpub\wwwroot\db.php on line 12
Is there anything that i've missed?
Did you change Edit System Variable and Windows extensions ?
You can find here : http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
Good luck..
Related
Actually, I followed all the paths in the document, but I still get an undefined sql error while connecting.
I followed these paths respectively.
1-Microsoft® ODBC Driver 11 for SQL Server® install
2-Microsoft Drivers for PHP for SQL Server this version: 7.3
dll files in the corresponding folder
php / ext
php_pdo_sqlsrv_73_nts_x64.dll
php_pdo_sqlsrv_73_ts_x64.dll
then I restarted xampp, i viewed phpinfo
But when I run my file the error I get is:
Fatal error: Uncaught Error: Call to undefined function
sqlsrv_connect() in
what could be missing?
You need to enable PHP Driver for SQL Server, but not PDO version. Function sqlsrv_connect() and all sqlsrv_ functions are part of the SQLSRV driver.
To enable the SQLSRV driver, you need to modify the php.ini by adding the appropriate line to the extension section - php_sqlsrv_73_nts_x64.dll or php_sqlsrv_73_ts_x64.dll depending on the PHP version.
Of course, as an option, you may try to rewrite your code using PDO (PHP Data Objects). The PDPO_SQLSRV part of the driver is installed on your WEB server.
I been trying to connect to my local MSSQL database using php.
Right now I am stuck at installing the correct drivers for php to work with MSSQL.
SO far I have:
1.Downloaded and setup Xampp
2.Downloaded the the SQLSRV driver at:https://github.com/Microsoft/msphpsql/releases/tag/v4.3.0
3.Placed the files within my extension_dir and double checked php.ini varible to point to the correct folder.
4. Manually added
extension=php_pdo_sqlsrv_71_ts.dll
extension=php_sqlsrv_71_ts.dll
to the list of extension within php.ini.
Yet I am still seeing the same Fatal error and a boolean checking if the driver has been loaded returns false:
bool(false)
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in
C:\xampp\htdocs\firsttest\api.php:9 Stack trace: #0 {main} thrown in
C:\xampp\htdocs\firsttest\api.php on line 9
Did I miss a step? I have been following different guidelines and some of them seemed outdated. I tried installing ODBC driver and the installer said that I had a higher version. Therefore I expect that shouldn't cause any problems.
By double checking everything I realize that Xampp always install as a 32-bit application. Therefore i should've taken the 86-bit version of the .dll files instead of the 64-bit.
Atleast this solved the problem for me.
I am trying to learn PHP with mongodb backend, but I could not connect PHP to mongo because of the following error:
fatal error Mongo class undefined
I am using Xampp and netbeans as IDE. I looked it up and got that the drivers are to be installed.
So I downloaded the drivers which is php_mongo-1.4.x-5.5-vc11.dll. I put it in the .../php/ext/folder and edit php.ini placing extention = php_mongo.....dll.
But still when I start my apache it says php_mongo...dll not found althought it is placed correctly. Also it says libsasl.dll not found, which when I looked up, it was in place.
I have mongodb installed and I have correct driver version, so why does it happen?
I am using:
Windows Server 2012
WAMP with PHP 5.4.12
Microsoft SQL Server 2012
I have downloaded the corresponding php_54_ts.dll and php_pdo_54_ts.dll and placed them in extension folder in wamp\bin\php, but still get this error:
Fatal error: Call to undefined function sqlsrv_connect() in C:\wamp\www\system\database\drivers\sqlsrv\sqlsrv_driver.php on line 76.
Have you enabled the sqlsrv extension in your php config?
You need to have:
extension=php_sqlsrv_54_ts.dll
in your php.ini file before you can use the extension.
This question already has answers here:
PHP Fatal error: Call to undefined function mssql_connect()
(3 answers)
Closed 3 years ago.
I'm running Windows Server, MS Sql and IIS6. I am trying to connect php to ms sql database, and I keep getting the following error from the script
Fatal error: Call to undefined function mssql_connect() in .... on line x
I have install zend studio in C:\Program Files\Zend\ZendStudio-5.5.0 directory. Configure IIS server and set the path variable to ;C:\Program Files\Zend\ZendStudio-5.5.0\bin\php5 also.
The zend studio folder contains php4 and php5 inside the bin dir. I have added extension=php_mssql.dll in the php.ini file which is inside the C:\Program Files\Zend\ZendStudio-5.5.0\bin\php5 folder. And added php_mssql.dll in the ext dir. php.ini file is placed in windows path C:\WINDOWS also.
To get changes made to php.ini to take effect, you must stop and start the IIS web service.
Also, mssql requires: ntwdblib.dll to be available on the Windows PATH. It is better to add the php folder to the Windows PATH instead of moving any files around. Re-logon or reboot your computer to get any changes made to the Windows PATH statement to take effect.
mssql_* API are no longer available on recent version of PHP
This extension is not available anymore on Windows with PHP 5.3 or later
you may need fix and compile yourself as it does not included in the open-source package.