PHP/pthreads extension
If you wish to have POSIX multi-threading you will need the pthreads extension (or the parallel extension for PHP 7.4+). To install the pthreads or parallel 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-pear: requires php
Uninstall all those including 'php'.
Use Asp to checkout these packages:
$ asp checkout php php-apache php-apcu php-pear
Change the file named PKGBUILD
in this folder to add --enable-maintainer-zts
, next to the other extensions. It should look like:
... --with-xsl=shared \ --with-zip=shared \ --with-zlib \ --enable-maintainer-zts ...
Make the new packages (you may need to edit permissions before):
$ makepkg -s
Install the packages you removed:
# pacman -U \ php-5.5.8-1-x86_64.pkg.tar.xz \ php-apache-5.5.8-1-x86_64.pkg.tar.xz \ php-pear-5.5.8-1-x86_64.pkg.tar.xz \
On some versions of PHP, php-pear
is missing and it is needed to run pecl
. As adding --with-pear
in the file above does not solve it, you will need to install it separately:
Then install pthreads:
or install parallel for recent PHP versions:
If you installed parallel, you will need to edit and add the parallel
extension, it should look like:
... ;extension=odbc ;zend_extension=opcache extension=parallel ;extension=pdo_dblib ...
Install the 'apcu' package for APC support back