I don't recommend using this on a high traffic site, but its PHP and MySQL based:
http://code.google.com/p/n0pe/
Dejiko is also OK, but it's missing quite a few features. Also uses a flatfile database.
http://neuchan.net/stuff/static/zipped/dejiko.zip (mirror this if you can)