Difference between revisions of "PHP pthreads extension"

From ArchWiki
Jump to: navigation, search
(PHP pthreads extension)
Line 51: Line 51:
{{bc|pecl install pthreads}}
{{bc|pecl install pthreads}}
'''Install the 'apcu' package for APC support'''
==Install the 'apcu' package for APC support back==
cd ../../php-apcu/trunk
cd ../../php-apcu/trunk
makepkg -si
makepkg -si

Revision as of 16:37, 15 November 2013

If you wish to have POSIX multi-threading you will need the pthreads extension. to install the pthreads (http://pecl.php.net/package/pthreads) extension using pecl you are required to use a compiled version of PHP with the the thread safety support flag --enable-maintainer-zts. currently the most clean way to do this would be to rebuild the original package with the flag.

Check what packages dependent on the php package, for example:

pacman -Qii php
:: php-apache: requires php
:: php-apcu: requires php
:: php-mcrypt: requires php
:: php-pear: requires php
:: php-pgsql: requires php

Remove all of them including 'php', so:

pacman -R php php-apache php-apcu php-mcrypt php-pear php-pgsql

Clone Archlinux's official package repository

cd /opt/
git clone git://projects.archlinux.org/svntogit/packages.git
cd packages/php/trunk

Make changes to add threads support


Should look something like

--with-xsl=shared \
--with-zlib \

Make the new packages

makepkg -s

Install the packages you removed

pacman -U \
php-5.5.6-1-x86_64.pkg.tar.xz \
php-apache-5.5.6-1-x86_64.pkg.tar.xz \
php-mcrypt-5.5.6-1-x86_64.pkg.tar.xz \
php-pear-5.5.6-1-x86_64.pkg.tar.xz \

Install pthreads

pecl install pthreads

Install the 'apcu' package for APC support back

cd ../../php-apcu/trunk
makepkg -si