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.
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.
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..
I am trying to install MongoDb on windows platform. I'm using PHP with WampServer.
But while executing the PHP program it gives the following error:
Fatal error: Class 'Mongo' not found in C:\wamp\www\test\index.php on line 19
So is there any way to check whether MongoDB is running with PHP or not ?
Please check php loaded extensions using phpinfo() function whether mongoDB extension is loaded or not.
Do check these as well.
Fatal Error - 'Mongo' class not found
Fatal error: Class 'Mongo' not found in xampp
Add the following line to your php.ini file:
extension=php_mongo.dll
Docs Link: http://php.net/manual/en/mongo.installation.php
Check this possible solution
Copy c:\wamp\bin\php\php-5.3.x\ext\
Edit c:\wamp\bin\apache\Apache2.2.xx\bin\php.ini and add the line where the extensions are loaded.
Why run WAMP on 32bit Windows 7 64bit?
The Mongo PHP driver does not have a 64bit binary win32, if you are running the 64bit version of WAMP, PHP will refuse to load the 32-bit version of php_mongo.dll.
Am using windows 8 pro, Wamp server (php V5.3.5, apache V2.2.17), Sql server 2005 express editon. I have downloaded the sqlsrv drivers and extracted them into the php extention folder (C:\wamp\bin\php\php5.3.5\ext), have also update the php.ini file by adding the extentions
extension=php_sqlsrv_53_ts_vc6.dll
extension=php_pdo_sqlsrv_53_ts_vc6.dll
I used this two after series of try and error on all the dll file, it was this two that come up with no error, when restarting the wamp server
This is the connection line of code;
$con = sqlsrv_connect('TAQUATECH\SQLEXPRESS') or die("cannot connect");
It came up with the following error;
Fatal error: Call to undefined function sqlsrv_connect() in
C:\wamp\www\Webs\client.php on line 7
pls, i need somebody to help me on this, i will really appreciate
Sorry if too late to answer, but I had the same error, and I found out that Wamp Server 64bit does not support SQL Server Connection, you must install a 32bit version of wamp server.
For those using 64-bit systems (OS, WAMP, MSSQL), these 64-bit drivers can serve them and fix the error:
Fatal error: Call to undefined function sqlsrv_connect() in C:\wamp\www...
Drivers SQLSRV x64:
http://robsphp.blogspot.in/2012/06/unofficial-microsoft-sql-server-driver.html
You'll need to install and enable sqlsrv on your web server. Have a look at the installation page on the official PHP website.
Installation of Microsoft Drivers 3.0 for PHP for SQL Server will fix this issue. Also try this PHP Manual.
EDIT :
The most recent version of the driver is available for download here:
» SQLSRV 3.0 download. If you need support for PHP 5.2 and/or PHP
compiled with VC6, use the 2.0 release of the driver: » SQLSRV 2.0
download.
Source
Yap, I have gotten a work-around;
The problem was, running the php script using apache server on my system, I stoped the wamp server and configure fastCGI for PHP using IIS 7, You can get a video tutorial Here
http://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/set-up-fastcgi-for-php.
It simple and nice, now i can connect to both sql server 2005 and 2008
My PHP Details
Version => 5.3.5
Compiler => MSVC6 (Visual C++ 6.0)
SqlSrv Driver => php_sqlsrv_53_ts_vc6.dll
use 32 bit PHP Version.
enable below one of them in php.ini
[PHP_PDO_SQLSRV_53_NTS]
extension=php_pdo_sqlsrv_53_nts.dll
[PHP_SQLSRV_54_NTS]
extension=php_sqlsrv_54_nts.dll
[PHP_SQLSRV_53_NTS]
extension=php_sqlsrv_53_nts.dll
[PHP_PDO_SQLSRV_54_NTS]
extension=php_pdo_sqlsrv_54_nts.dll
thease dll version you can downlowd online
I'm working on a project that uses the SQL Server Driver for PHP, and want to upgrade the driver to the new version (2.0), because I need some of the functions that have been implemented there.
I replaced the old .dll in the php/ext directory and restarted the web server. But now I receive the following error:
Fatal error: Call to undefined function sqlsrv_connect() in E:\ProjekteExtern\hades\_apl\classes\sql\sqlsrv.class.php on line 34
The phpinfo() output shows sqlsrv, just like with the previous version.
Does anybody know why I'm getting this error or have any ideas to solve this problem?
For those still having errors with PHP and Microsoft SQL Server using PHP SQL, check the web server's log (Apache, IIS, etc). I have just found out that WampServer x64 is not compatible with PHP SQL Server Driver, so I'm installing the 32-bit version back again.
UPDATE:
for WampServer 2.2, PHP is compiled thread-safe and with VC++ 9.0, so it works using either
php_pdo_sqlsrv_53_ts_vc9.dll
or
php_sqlsrv_53_ts_vc9.dll