Here is how I got it working under Linux Ubuntu distro - WITHOUT USE PECL:
We will download both, PHP and Pthread without PECL
1 - Get PHP version
For this example we will use version: 5.4.36
# wget http://www.php.net/distributions/php-5.4.36.tar.gz
2- Get Pthreads version:
I'm using an old version but, you could take any one
# wget http://pecl.php.net/get/pthreads-1.0.0.tgz
Extract both, php and pthreads versions
#tar zxvf php-5.4.36.tar.gz
#tar zxvf pthreads-1.0.0.tgz
3- Move Pthreads to php/ext folder. Inside version of PHP downloaded at item 1.
4- Reconfigure sources
# ./buildconf --force
# ./configure --help | grep pthreads
You have to see --enable-pthreads listed. If do not, clear the buidls with this commands:
# rm -rf aclocal.m4
# rm -rf autom4te.cache/
# ./buildconf --force
5 - Inside php folder run configure command to set what we need:
# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc
6 - Install PHP
We will run make clear just to be sure that no other crashed build will mess our new one.
# make clear
# make
# make install
7 - Copy configuration file of PHP and add local lib to include path
# cp php.ini-development /etc/php.ini
Edit php.ini and set Include_path to be like this:
Include_path = “/usr/local/lib/php”
9 - Check Modules
# php -m (check pthread loaded)
You have to see pthreads listed
10 - If pthread is not listed, update php.ini
# echo "extension=pthreads.so" >> /etc/php.ini