0

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!

8
  • 2
    See - stackoverflow.com/questions/9986804/… Commented Oct 26, 2012 at 18:56
  • +1 for link. But, I just don't get sqlsrv in my php info to start with. That is the main issue with me. Commented Oct 26, 2012 at 19:06
  • Maybe you are missing the dll or didnt configure it properly ? Commented Oct 26, 2012 at 19:08
  • Also check what is your extension directory. If it is in ext directory, then you might write ext/php_sqlsrv_54_ts.dll Commented Oct 26, 2012 at 19:09
  • I double-checked, the dll are there in ext folder and php.ini has correct path for extension_dir. ( I just set absolute path). Wondering if there is an issue with version of dlls or something weird going on Commented Oct 26, 2012 at 19:13

1 Answer 1

0

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. :)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.