I haven't found any proper instructions on how to install pthreads in linux, so I'll leave the steps I followed:
# Required libraries
sudo apt-get install gcc make libzzip-dev libreadline-dev libxml2-dev \
libssl-dev libmcrypt-dev libcurl4-openssl-dev lib32bz2-dev
# Download PHP
cd /usr/local/src
wget http://www.php.net/distributions/php-<version>.tar.gz
( e.g. wget http://www.php.net/distributions/php-5.5.8.tar.gz )
# Extract
tar zxvf php-<version>.tar.gz
(e.g. tar zxvf php-5.5.8.tar.gz )
# Configure
cd /usr/local/src/php-<version>
( e.g. cd /usr/local/src/php-5.5.8 )
./configure --prefix=/usr --with-config-file-path=/etc --enable-maintainer-zts
# Compile
make && make install
( make -j3 && make -j3 install) -> Faster building
# Copy configuration
cp php.ini-development /etc/php.ini
# Install pthreads
pecl install pthreads
echo "extension=pthreads.so" >> /etc/php.ini
# Check installation
php -m | grep pthreads