Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Danne Lundqvist's Blog:
Adding support for MS SQL Server to PHP in Linux
Jan 06, 2010 @ 14:19:11

Danne Lundqvist has a new post showing how to get MS SQL Server support to work with your PHP installation on linux with the help of the FreeTDS tool.

Adding support for MS SQL Server in PHP is not very difficult. Searching (Google/Bing/whatever) reveals lots of information on how to do this with Windows - naturally - but very little on how to go about it using Linux. Most people use precompiled PHP installations and I will show how to add MS SQL Server support to a precompiled PHP installation here. Those of you compiling PHP yourselves will probably understand what to do and what not based on the information here as well.

You'll have to get and install (compile) the latest version of the FreeTDS software, install the mssql extension from the PECL repository and install the extension into your PHP instance. With it installed and working, you can change the configuration file to add in whatever server information you'd like.

tagged: mssql server linux module freetds tutorial

Link:

Lukas Smith's Blog:
Persistent connections with MSSQL
Dec 11, 2008 @ 18:01:26

Lukas Smith is looking for a little help on a strange problem he's seeing connecting to a SQL Server with persistent connections:

We are connecting to SQL Server via mssql_pconnect(). MaxChilds is set to 256 and we are only establishing one connection per request. So as a result I am expecting a maximum of 256 established connections. A client went into production yesterday and due to a missing index the server ended up being insanely loaded, as the queries started to block each other. The sysadmin checked the state of things via netstat and found that there were close to 500 tcp connections to the SQL Server. What gives?

He checked FreeTDS and the MaxRequestsPerChild settings to ensure that nothing there could have caused the problem, but hasn't found any hints so far. If he can't solve it right away, he also wonders if there's a way to kill idle connections if they're not used in a certain amount of time.

There's already one connect that mentions a similar issue but with Oracle connections, also on RHEL, but no definitive answers so far.

tagged: persistent connection mssql mssqlpconnect tcp problem freetds

Link:

Michael Kimsal's Blog:
SQL Server driver for PHP5
Feb 12, 2008 @ 14:48:00

In a new blog entry, Michael Kimsal points out a driver that Microsoft has released (during the end of last year) that allows PHP5 applications to connect directly to a SQL Server database.

This isn't replacing freetds any time soon. I guess I'm still wondering what the market for "PHP apps deployed on Windows talking to SQL Server" really is - most of the shared hosting accounts I've seen, even on Windows, offer MySQL or Access as the database.

He also points out a video that was shot of the development team talking about the driver (here's their blog too).

tagged: sqlserver microsoft driver php5 freetds mysql

Link:


Trending Topics: