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 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 thepackage, for example:
$ pacman -Qii php
:: php-apache: requires php :: php-apcu: requires php :: php-pear: requires php
Uninstall all those including php.
... --with-xsl=shared \ --with-zip=shared \ --with-zlib \ --enable-maintainer-zts ...
Make the new packages with makepkg, then install the rebuild version of the packages you had previously removed:
# pacman -U \ php-version-release-x86_64.pkg.tar.zstd \ php-apache-version-release-x86_64.pkg.tar.zstd \ php-pear-version-release-x86_64.pkg.tar.zstd \
On some versions of PHP,
pecl. As adding
--with-pear in the file above does not solve it, you will need to install it separately.
Then install pthreads:
$ pecl install pthreads
or install parallel for recent PHP versions:
$ pecl install parallel
If you installed parallel, you will need to edit
/etc/php/php.ini and add the
parallel extension, it should look like:
... ;extension=odbc ;zend_extension=opcache extension=parallel ;extension=pdo_dblib ...
Install thepackage for APC support back.