As you can see in the referenced Bug, the value of RTLD_STATIC_TLS_EXTRA in /usr/src/libexec/rtld-elf/rtld.h should be increased. I'm unsure how large it realy needs be to avoid such bugs, but according to http://lists.dragonflybsd.org/pipermail/bugs/2013-June/311813.html i tried it with 1280 and the failures in PHP went away. Hopefully this is the correct way of fixings this issue. Thanks for your great work!