[freetds] Mac OS X 10.4/FreeTDS .63/PHP 4.4.0 Configuration

Daniel Fazekas fdsubs at t-online.hu
Mon Aug 22 14:31:42 EDT 2005


On Aug 22, 2005, at 16:31, Dennis Crall wrote:

> --with-iodbc=/usr --with-mssql=shared,/usr/local/freetds   --with-apxs
[...]
> However, when I make a call to one of PHP's mssql_ functions, I  
> receive the
> following error: "Fatal error: Call to undefined function:  
> mssql_connect()".

That sounds simple enough. Since you instructed php's configure  
script to build the mssql extension as a dynamically loadable shared  
library, you'll have to tell it to actually load it.
There are many ways and places to do that; one of the advantages of  
having extensions in a shared library.

You can add a line saying
extension=mssql.so
to your php.ini file. You told php to look for that in /etc, so it  
should be in /etc/php.ini

Also make sure your extension_dir setting points to the right place.  
If you don't mess with it and just let php use its defaults, it will  
automatically point to the correct folder.

Since you are using Apache 1, as an alternate option, the dl()  
function is also available. You can write dl('mssql.so'); inside your  
php script to load it.

Check your PHP manual for even more places and ways to load a shared  
extension if you are so inclined.

> Is anyone using FreeTDS to support the mssql functionality in PHP  
> on OS X?

It's the only option for building the PHP mssql extension on Mac OS X  
- or any other Unix system, for that matter.

--
fds



More information about the FreeTDS mailing list