PHPKonf 2020 Online


Table of Contents

add a note add a note

User Contributed Notes 6 notes

robyn at dcphp dot com
9 years ago

This links to xampp works great on macs. I have put it only for PPC machines, but it claims to work properly on Intel as well.

I also had success installing FreeTDS and PHP from source on an Intel Macbook, running Mac OS 10.6 (Snow Leopard). My steps were the following:

step 1: download latest php version
step 2: un-tar the php source code
step 3: download latest freetds version
step 4: un-tar the freetds source code

step 5: make sure there is a writable directory at /usr/local/freetds
step 6: "cd" to the freetds source directory
step 7: run "sudo ./configure --prefix=/usr/local/freetds --enable-msdblib"
step 8: run "sudo make"
step 9: run "sudo make install"
step 10: run "touch /usr/local/freetds/include/tds.h" (add blank, but necessary files)
step 11: run "touch /usr/local/freetds/lib/libtds.a" (add blank, but necessary files)

step 11: "cd" to the php source directory
step 12: run "sudo ./configure --disable-all --with-mssql=/usr/local/freetds"
step 13: run "sudo make"
step 14: run "sudo make install"

Of course, since I was disabling-all (step 12) that means that you have to explicitly add back those modules you want to configure php with.
mark dot treble at marktreble dot co dot uk
10 years ago
If anybody is looking for the api documentation now - (26 May 2010), it can be found at:
Hiren Dave
5 years ago
To install it on MAMP on OSX, please check my blog here.
xmak at studioartlan dot com
7 years ago
For the 64-bit architecture in some cases you need to link /usr/local/freetds/lib64 to /usr/local/freetds/lib.
See here:
dragos at rdss dot ro
9 years ago
mssql install-setup as so on linux:

get freetds package
1. wget
2. uncompress and cd 2 sources folder
3. ./configure --enable-msdblib --prefix=/usr/local/freetds
4. make
5. make install
copy some supplementary files
6. cp include/tds.h /usr/local/freetds/include
7. cp src/tds/.libs/libtds.a /usr/local/freetds/lib

get php devel sources if you don't have it and install it
get php sourcers files, uncompress it, chdir
8. chdir ext/mssql
8. phpize
9. ./configure --with-mssql=/usr/local/freetds
10. make
11. cp modules/ phpextensionpath, or make install

12. echo "/usr/local/freetds/lib" >> /etc/
echo "export FREETDSCONF=/usr/local/freetds/etc/freetds.conf" >> /etc/profile
add in extension section
13. to php.ini
add in httpd.conf right above "Include /etc/httpd/mod_php.conf"
14.SetEnv FREETDSCONF /usr/local/freetds/etc/freetds.conf
15. set you server connection in /usr/local/freetds/etc/freetds.conf

for testing w/o reboot server:
16. export FREETDSCONF=/usr/local/freetds/etc/freetds.conf
17. restart apache
18. verify mssql enabled with phpinfo()
19. run your test script.
20. other fine tunnigs and settings

pls. keep in mind:
- your ms SQL must be setup with socket listing ;)
- check windoze box firewall to accept TCP 1433 connection.

jklowden at freetds dot org
12 years ago
The 30-character limitation  does not apply to the FreeTDS db-lib implementation.  FreeTDS returns column names of any length supported by the server (and protocol).
To Top