I have actually come across quite a few post about the same subject question, but I to be still can not to fix it and also so ns ask. Ns am trying to attach to sql in my php script. My link string is:
/* specify the server and also connection cable attributes. */$serverName = "xxx-PC\SQLExpress";$connectionOptions = array("Database"=>"Salesforce");$conn = sqlsrv_connect($serverName, $connectionOptions);if($conn === false) die(print_r(sqlsrv_errors(), true));I have actually installed and also included the adhering to in mine php.ini document located under the wamp folder: C:\wamp\bin\php\php5.4.16:
extension=c:/wamp/bin/php/php5.4.16/ext/php_sqlsrv_53_ts.dllMy wampserver is to run fine and also so space the wampapache and wampsqld services. I am able come execute php.exe successfully. Yet I am unable to do the link to SQL Server 2008 R2 where my database is located. Please help!
EDIT 1: The wamp server is to run the wampmysql service while ns am do the efforts to affix to SQL Server 2008 R2. Can this be the reason? have to I be using MySQL instead of SQL? any type of pointers?
EDIT 2: I carry out not see sqlsrv section at all as soon as I run phpinfo() though i have included extension=php_sqlsrv_54_ts.dll in the php.ini file located in the bin folder the the wamp server.
asked By: sarah
When you download third-party expansions you should make certain that every the compilation parameters match:PHP versionArchitecture (32/64 bits)Compiler (VC9, VC10, VC11...)Thread safety
Common relief includes:Editing the not correct php.ini file (that"s common with bundles); the right path is presented in phpinfo().Forgetting come restart Apache.
You are watching: Call to undefined function sqlsrv_connect
Not being able to view the startup errors; those should present up in Apache logs, yet you can likewise use the command line to diagnose it, e.g.:
php -d display_startup_errors=1 -d error_reporting=-1 -d display_errors -c "C:\Path\To\php.ini" -mIf everything"s best you need to see sqlsrv in the command output and/or phpinfo() (depending on what SAPI you"re configuring):
reply By: Sarah
If you space using Microsoft motorists 3.1, 3.0, and also 2.0.Please check your PHP version already install v IIS.Use this script to check the php version:
echo phpinfo(); ?>OR
If you have installed PHP Manager in IIS using net platform Installer friend can check the version from it.
Then:If you space using new PHP variation (5.6) you re welcome download chauffeurs from here For PHP version lower than 5.6 - you re welcome download chauffeurs from herePHP Driver variation 3.1 needs PHP 5.4.32, or PHP 5.5.16, or later.PHP Driver variation 3.0 calls for PHP 5.3.0 or later. If possible, usePHP 5.3.6, or later.PHP Driver variation 2.0 driver works v PHP 5.2.4 or later, but notwith PHP 5.4. If possible, usage PHP 5.2.13, or later.
Then use the PHP Manager to add that downloaded motorists into php config file.You can do it together shown listed below (browse the files and also press OK).Then Restart the IIS Server
If this method not work please adjust the php version and try to operation your php script.
See more: Unable To Find An Ant File To Run Ant Build In Eclipse, Programmers Repository: Eclipse
Tip:Change the php variation to lower and shot to understand what happened.then you deserve to download appropriate drivers.