Difference between revisions of "PHP pthreads extension"

From ArchWiki
Jump to: navigation, search
m (A few minor grammar corrections)
m (Add Category. See Help:Category.)
Line 1: Line 1:
 +
[[Category:Programming language]]
 
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 {{ic|pecl}} you are required to use a compiled version of PHP with the the thread safety support flag {{ic|--enable-maintainer-zts}}. currently the most clean way to do this would be to rebuild the original package with the proper flag.
 
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 {{ic|pecl}} you are required to use a compiled version of PHP with the the thread safety support flag {{ic|--enable-maintainer-zts}}. currently the most clean way to do this would be to rebuild the original package with the proper flag.
  

Revision as of 05:28, 16 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 proper flag.

Check what packages depend 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', for example:

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 the changes to add threads support

vim PKGBUILD

Should look something like

...
--with-xsl=shared \
--with-zlib \
--enable-maintainer-zts
...

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 \
php-pgsql-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