Page 1 of 1

PHP with MS Sql Server - Problem w/ Configuration

Posted: Thu Aug 07, 2003 2:28 pm
by tdelobe
I am having a problem configuring PHP to work with MS SQL SERVER. Everytime I edit the php.ini file and uncomment the extension=php_mssql.dll line it craps out my dev site. Am I missing something.

Does anyone have any good directions on how to configure PHP to use with SQL SERVER DB? I was using these directions but seem to have run into a problem...http://www.devarticles.com/art/1/100/2

Is there anything better out there?

Posted: Thu Aug 07, 2003 3:16 pm
by seiretto
Hi Tim,

I have had this problem.

php_mssql.dll fails to load with absence of ntwdlib.dll

Find ntwdlib.dll and copy to your windows system directory.

And that should get you up and jogging....

All the best.

Dave

Posted: Tue Aug 12, 2003 9:01 am
by tdelobe
Hmmm, I have both php_mssql.dll and ntwdlib.dll copied into my system32 directory, have restarted the webserver and all and still nothing. It will not pull the sql. Am I missing something else?

Posted: Tue Aug 12, 2003 9:17 am
by seiretto
Tim,

Why not ditch Microsoft and install MySQL? - http://www.mysql.com/

PHP and MySQL will always enjoy life together ;-)
"They are the perfect couple!"

Dave Walker

http://www.seiretto.com/

Posted: Tue Aug 12, 2003 9:20 am
by tdelobe
Yeah I know....I would like to use MySQL, but they already have a pretty big database going with SQL Server here, and I need to use those tables for the web stuff I am going to do.

I think I might have just found the issue though...we will see. 2 versions of PHP are running right now on the server. Systems guy forgot to uninstall the old one before installing the new version. I think that could be it. We will see...

PHP mssql.dll on Windows

Posted: Sat Aug 16, 2003 8:09 am
by dnuttall
Tim,
I've had a similar problem and I don't think I've ever made the PHP extension work with IIS. However, with Apache2 on Win2K, I do have it working, but not until I copied more than the ntwd*.dll to the \winnt directory. I'm pretty sure the iconv.dll (from PHP\dlls) and I'm not sure about the php4ts.* files from PHP to \winnt.

Then I just leave the php_mssql.dll in the php\extensions directroy, uncomment and restart Apache and it does NOT barf, so the next step is to try and make it connect to your database.

On the other hand, my personal/professional view is to NOT write/support applications that are too database specific, so I've adopted John Lim's ADODB database abstraction library and use and ODBC connection and his "odbc_mssql" specific driver.

I know some people don't care for ODBC, but in my experience its been a lot faster and easier to move stuff around when I want/need to.

YMMV.
Good luck and come back to me off-line if you want to pursue ideas.

Best regards from San Antonio, TX
Dave Nuttall

Posted: Mon Dec 29, 2003 8:04 pm
by pkien168
Do i have to use win nt.....and no xp possible?
I'm trying to make phpBB to work with mssql server. I cant seem to find the php_mssql.dll.

Kien

Posted: Tue Dec 30, 2003 5:53 am
by dnuttall
pkien168 wrote:Do i have to use win nt.....and no xp possible?
I'm trying to make phpBB to work with mssql server. I cant seem to find the php_mssql.dll.

Kien
Of course, XP is possible. The problem you're trying to overcome is NOT operating system related, but PHP related.

I'm guessing that you probably installed the standard "Windows installer" package of PHP. That's fine. But now, go grab the full ZIPPED package and expand it where ever it installed PHP (i.e., usually in C:\PHP unless you gave it a different path).

You may have to actually copy/move stuff from the expanded ZIP and if it overwrites files in your C:\PHP folder, that's usually OK in my experience.

The FULL complement of *.dlls/extensions is ONLY found in the large ZIPPED download from http://www.php.net.

FWIW, I've found that using an ODBC connection to MSSQL, regardless of whether it was MSSQL 7 or 2000.

Additionally, you'll also have good/better luck with some packages that use either PEAR or the ADODB database abstraction layer, so the code does NOT become DB and version specific. Personally, I prefer the ADODB package, but some well crafted packages available rely on PEAR.

Post again if you continue to have difficulty. No guarantees that "we" can resolve any/all problems you may encounter, but its not impossible to make PHP work on Windows, you just have to "tinker" a bit sometimes.

Good luck.

Dave

Posted: Tue Dec 30, 2003 9:05 am
by pkien168
oh man tell me about it....took me a while to figure out what is actually happening, the copy and paste of config files to and from directories are crazy.

Finally got it to work, first problem is that i installed the ms sql to use window authentication rather than the other option. It successfully installed now......BUT it doesnt work properly.

The problem now is that when i sign in as an admin to the control panel, i get redirected to the admin folders....i just cant get into the proper control panel...any ideas?

Kien

Posted: Tue Dec 30, 2003 9:21 am
by dnuttall
pkien168 wrote:The problem now is that when i sign in as an admin to the control panel, i get redirected to the admin folders....i just cant get into the proper control panel...any ideas?

Kien
Sorry, but you're on your own from my perspective, since I don't have any recent experience with that/those "forums" applications. Sounds like it could be something in a configuration parameter, but that is 100% guess.

Good luck.
d.