I would like to use the multithreading PHP on Ubuntu, but when I try to install the package pthread, I get this error message:

configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled.

share|improve this question
HOW TO INSTALL IN LINUX SYSTEM'S:
------------------------------------

1) Download PHP sources and Unpack PHP

2) Download PEAR
     wget http://pear.php.net/go-pear.phar
     php go-pear.phar

3) Download pthreads
Get PECL extension (PECL is a repository for PHP Extensions)

# pecl install pthread-0.4.4

4) Unpack pthreads
copy pthread-0.4.4  to  php/ext
(for ./configure allow  add option --enable-pthreads)

# mv build/php-src-master/ext/pthreads-master    build/php-src-master/ext/pthreads

5)  Reconfigure sources
# ./buildconf --force
# ./configure --help | grep pthreads

You should see the appropriate --enable-pthreads option listed as a result, if you do not, then

# rm -rf aclocal.m4
# rm -rf autom4te.cache/
# ./buildconf --force

6) Build PHP
Compile PHP source code
Add:
# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads

7) Installing PHP
# make
# sudo make install

8) Update php.ini
Add in php.ini
extension=pthreads.so
Include_path = “/usr/local/lib/php”

9) Check Modules
php -m (check pthread loaded)

10) Test Thread Class
# php SimpleTest.php
share|improve this answer
    
Doing pecl install pthread-0.4.4 I get the error: No releases available for package "pecl.php.net/pthread" install failed Do you know what am I doing wrong? – Juanjo Lainez Reche Aug 12 '15 at 14:13

I think you can use this PPA repository to add PHP5 with ZTS enabled:

https://launchpad.net/~ondrej/+archive/ubuntu/php5

sudo add-apt-repository ppa:ondrej/php5

sudo apt-get update

sudo apt-get upgrade
share|improve this answer
1  
i have the same error message. – lipdjo Sep 5 '14 at 14:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.