It seems, Ubuntu doesn't have a package for the thread-safe PHP in the official repositories.
Pthreads extension requires ZTS. Thus, you have two options:
- compile it yourself:
- find a .deb package somewhere, e.g. repositories of the other Debian-like systems.
I'd compile and package it myself using "checkintsall" utility. Thus, Apt will have ability to keep track of PHP version. I would also request Canonical for a package for ZTS PHP.