PHP and MSSQL configuration

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP and MSSQL configuration

Postby Batric » 07. March 2009 12:13

Hello,

I am trying to run PHP+MSSQL application. Don't ask me why, it has to be that way :D

The PHP files are on my local machine, and the MSSQL database on a windows web server. From that side I believe everything is OK.

But the problem is in my local PHP settings.

I did the following:

1) uncommented the lines: "extension=php_mssql.dll" and "extension=php_pdo_mssql.dll" in all kinds of php.ini files found in my XAMPP folder
2) downloaded "ntwdblib.dll" file and put it into php folder

But there is still no success.

Is there any additional setup or configuration to be done, so the PHP in my localhost can communicate with MSSQL database on a web server?
Anyone with similar experience? How did you solve the problem?

Thank you in any case :D

Batric


EDIT: Forgot to mention - I use XAMPP 1.6.8 lite (the newest is causing me troubles)
Batric
 
Posts: 8
Joined: 07. December 2008 17:12

Re: PHP and MSSQL configuration

Postby Izzy » 07. March 2009 12:33

xampp\apache\bin\php.ini file is the place to edit and you can always find the php.ini file in use by going to http://localhost/xampp/phpinfo.php and look for the line Loaded Configuration File.

BTW why the lite version of XAMPP and not the full version?
Last edited by Izzy on 12. March 2009 07:58, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP and MSSQL configuration

Postby Batric » 07. March 2009 13:03

Izzy wrote:xampp\apache\bin\php.ini file is the place to edit and you can always find the php.ini file in use by going to http://localhost/xampp/phpinfo.php and look for the line Loaded Configuration File.

BTW why the lite version of XAMPP and not the full version?

Thanks for fast answer!

I changed the xampp\apache\bin\php.ini file too (uncommented MSSQL two lines).

And here's what the phpinfo says about the MSSQL support:

Image

XAMPP lite because somehow it works the best on my machine :? full version is making me a bunch of problems


How to turn "on" the MSSQL compatibility? (you can see it on image)
Batric
 
Posts: 8
Joined: 07. December 2008 17:12

Re: PHP and MSSQL configuration

Postby Izzy » 07. March 2009 13:13

In the same php.ini file is a section [MSSQL] where those above values are configured but your on your own there as I don't use nor have I any need to use MSSQL but there must be lots of info on Google perhaps.

There are a few results when I searched this forum for MSSQL but I didn't read any of them but you might want to perhaps.
Last edited by Izzy on 12. March 2009 08:00, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP and MSSQL configuration

Postby Batric » 07. March 2009 14:00

Yes, I found that section and changed the "mssql.compatability_mode" to ON but it is not showing in the phpinfo

I'll try to do it again, and to search on the net - at least now I know what is probably the issue

Thanks again for the answer!
Batric
 
Posts: 8
Joined: 07. December 2008 17:12

Re: PHP and MSSQL configuration

Postby Izzy » 07. March 2009 14:04

Clear your browser's cache when working at localhost level or you will more than likely be served a cached page instead of a fresh page from the server.
Last edited by Izzy on 12. March 2009 08:02, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP and MSSQL configuration

Postby Batric » 07. March 2009 14:13

I always do that :D

Just stopped the apache and started it again - now the "mssql.compatability_mode" is ON but the application is still not working. :shock:

Errors are the same as before:
- Unable to connect to server
- A link to the server could not be established
(I'm pretty sure that the DB connection strings are correct)

I'll try to uninstall the apache service and to install it again. Maybe that will help
Batric
 
Posts: 8
Joined: 07. December 2008 17:12

Re: PHP and MSSQL configuration

Postby Izzy » 07. March 2009 14:51

Some useful links if you don't have them already:
http://us2.php.net/mssql
http://www.userscape.com/helpdesk/index ... page&id=13
http://www.userscape.com/helpdesk/index ... d=10&pc=10

http://us2.php.net/manual/en/mssql.setup.php - this link explains that the poster deleted the file ntwdblib.dll from the php folder as it was already in the windows\system32 folder which fixed the Unable to connect to server issue.
Another said it goes in the apache\bin folder.
I believe that this file's location should be sorted out as it may have implications on your error message.

This Google provided some possible answers.

Another Google with more clues perhaps.

HTH
Last edited by Izzy on 12. March 2009 08:04, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP and MSSQL configuration

Postby Batric » 10. March 2009 19:02

It works now :D

I just installed it on another machine.

The only difference that there was MSSQL 2008 installed.

Don't know how that could affect the working of the application.

Izzy thanks for help!
Batric
 
Posts: 8
Joined: 07. December 2008 17:12

Re: PHP and MSSQL configuration

Postby make-fun » 11. March 2009 11:39

Hi there,
this most likely got nothing to do with PHP — had the same problem a few years ago and turned out to be a thing of permissions within MSSQL.
I'd have to look it up again, so if you have more trouble just post again…
Cheers
make-fun
 
Posts: 31
Joined: 11. March 2009 04:21


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 224 guests