How to recompile PHP 8.1.9/cPanel 104.0.7 with ZTS extension enabled?


Active Member
Nov 25, 2006
I have cPanel & WHM 104 (build 7) on a CentOS 7.9 server, with PHP 8.1.9. I would like to install the PHP Parallel extension, which requires ZTS.

From the instructions there I tried installing with pecl:
/opt/cpanel/ea-php81/root/usr/bin/pecl install parallel
But at the end I get the error:
checking for ZTS... configure: error: parallel requires ZTS, please use PHP with ZTS enabled
ERROR: `/root/tmp/pear/parallel/configure --with-php-config=/opt/cpanel/ea-php81/root/usr/bin/php-config' failed
I also tried installing from source:
git clone
cd parallel
./configure --enable-parallel --with-php-config=/opt/cpanel/ea-php81/root/usr/bin/php-config
But I get the error:
checking for ZTS... configure: error: parallel requires ZTS, please use PHP with ZTS enabled
I asked my web host about this extension and they said:
On all of our servers that have control panels, PHP is RPM built and is not a source install so we cannot just compile new modules into it if they don't fit what the control panel has installed.

We are unable to compile in support for ZTS on this server since it is an RPM-provided install of apache and php.
Is there any way for me to manually add ZTS to my PHP? Do I need to re-compile, and if so would this carry risks? I don't really know what I'm doing and I don't want to break anything, and my web host is not wiling to do this for me.

I found this thread that describes how to re-make PHP:

If I follow the instructions listed there with php-8.1.9.tar.gz, would there be any conflicts or issues with cPanel? Would cPanel later try to revert the changes or anything like that? Here's what I think the instructions from that thread look like, with 8.1.9 instead:
wget && tar zxvf php-8.1.9.tar.gz
yum install -y libxml2-devel sqlite-devel
cd php-8.1.9 && ./buildconf --force && ./configure --enable-debug --enable-zts --prefix=/usr --with-config-file-path=/etc
make && make install
Would it be safe to execute these instructions? If I try this, is there anything I should back up first?

Any advice or suggestions or guidance is appreciated.


Well-Known Member
Jun 9, 2020
cPanel Access Level
Root Administrator
You would need to build your own RPM for PHP to include ZTS. Similar to what @dalem said in this thread earlier:

  • Like
Reactions: Kadence and cPRex


Jurassic Moderator
Staff member
Oct 19, 2014
cPanel Access Level
Root Administrator
You definitely don't want to try and manually compile anything on the cPanel server, as it won't work well and won't integrate with the cPanel tools at all. Creating that custom RPM using the details that @andrew.n provided is the best way to make this happen, even though it is a bit more complicated.
  • Like
Reactions: Kadence