leonz.com

My Notes

Adding mssql to Filemaker PHP

posted by Leonard Wee   [ updated ]

At work, I had to get data from a Microsoft SQL Server 2005 database to a Filemaker CWP website running on OSX. For once, Google did not help much as it was a relatively obscure scenario. I ended up compiling FreeTDS with the mssql PHP extension from whatever notes I could find online. I post this as a note for myself and to save time for anyone who happens to be in a similar situation.

The versions I worked with are:
OSX: 10.6.1
PHP: 5.2.9 (installed by Filemaker Server 10)
FreetDS: 0.82

The difficulties I had was because the Filemaker CWP website was not running off the default OSX install of PHP but Filemaker's so I had to tweak locations and I am not even 100% sure I got it right. But the mssql functions seem to be working OK so YMMV :-)

BTW, the correct solution is to buy a solution from these guys. But if you're feeling masochistic, carry on reading.



Install xcode (to get gcc to compile sources)

Download FreeTDS and install it:
./configure --prefix=/usr/local/freetds --disable-odbc --disable-libiconv --enable-msdblib
make clean
make
make install


Download the PHP sourcecode and compile it (LIBS=-lresolv needed to compile v5.2.9). 
cd php-5.2.9
LIBS=-lresolv ./configure --with-iconv=shared,/opt/local
make


Prepare environment for the mssql.so extension
replace the php folder (either make a copy or link) in
/usr/include
with
/Library/FileMaker Server/Web Publishing/publishing-engine/php/include

Make a copy of the folder:
/Library/FileMaker Server/Web Publishing/publishing-engine/php
to a location like
/temp/php
This is because the phpize script does not work with spaces

In usr/bin/phpize, change the following lines near the top (bascially replace "usr" with the copy above):

prefix='/usr'
to
prefix='/temp/php'

SED="/usr/bin/sed"
with
SED="/temp/php/bin/sed"


Build the mssql.so extension
cd ext/mssql
phpize
./configure --with-mssql=/usr/local/freetds
make


Install the compiled extension
cp modules/mssql.so /usr/lib/php/extensions/no-debug-non-zts-20060613

Edit the php.ini file in "/Library/FileMaker Server/Web Publishing/publishing-engine/php/lib/php.ini"
Add the line "extension=mssql.so"


Add the connection details to /usr/local/freetds/etc/freetds.conf
[example]
example.com
port = 1433
tds version = 7.0


Restart Apache
sudo /usr/sbin/apachectl restart


Troubleshooting Tips
You can check errors by adding (uncomment) this also in the freetds.conf
dump file = /tmp/freetds.log
dump file append = yes

Check for PHP and errors (while trying to load module etc) in the apache logs:
/var/log/apache2/error_log

Addressing Elders

posted by Leonard Wee   [ updated ]

This is what I have been told. I am unsure if it is Hokkien or Peranakan or a combination of both. But this is the naming convention I am familiar with. i.e. these are the terms I would use when addressing my aunties and uncles.

Prefix
The hokkien numbering system is used. However the eldest will always be called "tua" which means "big". So we have:
First: tua
Second: ji
Third: sa
Fourth: si

When unsure of the position within (or if just lazy), we just use "ah" instead of the number. These days, it has become relatively informal. For example, an uncle could be called "ah cek" because it is how it ended up. I have also noticed that the naming system starts to sound very strange after 4. Hence I suspect younger siblings after the fourth are just simply prefixed with "ah".

Paternal Suffix

Father's Younger brother: cik
Father's Younger brother's wife: jim

Father's Older brother: peh
Father's Older brother's wife: imm

Father's Sisters: kor
Father's Sister's husband: teoh

Maternal Suffix

Mother's brothers: gu
Mother's brother's wife:kim

Mother's sisters: yi
Mother's sister's husband: teoh

Examples
The eldest uncle on my father's side would be called "Tua Peh"

My 2nd auntie on my mother's side would be called "Ji Yi"

Incidentally, if I had a 13th auntie on my mother's side that I addressed in mandarin (rather than hokkien), she would be "Shi San Yi" :-).

Buying a house in Melbourne

posted 26 Jul 2010 18:43 by Leonard Wee   [ updated 26 Jul 2010 19:25 ]

Check Crime Rate of the suburb

Check ranking of nearby schools. In Victoria, allocation is primarily based on the straight line distance from the home to the school. Hence, the "search nearby" feature of Google Maps is pretty handy to see which school is the closest.

There is a lot of good advice on buying and selling houses here:

This website uses Google Maps to estimate land area. It is very useful to gauge the land size.

Check for nearby developments

‹ Prev    1-3 of 3    Next ›