2

I need to connect to a MS SQL Server on Windows from PHP running on Red Hat Enterprise Linux 4. I have installed FreeTDS and I can connect to the database using the tsql command.

My current PHP does not have the mssql functions/extension.

My question is, how do I set up the mssql extension without rebuilding PHP? Is there a prebuilt package for this? I have tried googling for this but I have had no luck.

2 Answers 2

3

If you are using the stock version of PHP that comes with RHEL 4.x, you can install the php-odbc module. FreeTDS provides an ODBC interface. You should be able to use these together to connect PHP to a MSSQL server.

That said, I suggest rebuilding PHP so you have access to the mssql extension. That should result in better performance and reliability than using ODBC in this fashion.

(For what it's worth, RHEL 5.x has a php-mssql RPM you can install.)

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

1 Comment

Thanks to you I did my first configure, make, make install! Except with about 20 arguments to the configure command. Victory is mine!
0

There is no way you can setup mssql extension to work without rebuilding PHP. PHP Group aims at giving interoperatable and independent code. MS SQL and Sybase both require freetds, which isn't and shouldn't be part of PHP Package. Maintaining a rpm or deb for a custom package would again be a pain. Hence you have to manually build it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.