• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Install pthreads for PHP in PLESK

Johnny9977

Basic Pleskian
I'm looking for a way to install pthreads in PLESK for PHP. I've searched a lot but can't find any tutorial or How-To for this. Is there anyone who can say me how I can install pthreads in PLESK?

krakjoe/pthreads

I need to do this because I'm getting an error message when I try to extend a class in PHP by Thread:

PHP:
Fatal error: Class 'Thread' not found

I've checked the installed modules in PLESK but there is no pthreads to enable

https://i.stack.imgur.com/B1R2B.png
 
You can try to compile pthreads module for Plesk PHP with something like:

# apt-get install make gcc plesk-php73-dev
# /opt/plesk/php/7.3/bin/pecl install pthreads

and so on, but you will see error:

checking for ZTS... configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled
ERROR: `/tmp/pthreads/configure --with-php-config=/opt/plesk/php/7.3/bin/php-config' failed

The problem in that Plesk PHPs are compiled without ZTS.
But you can compile your own PHP version with ZTS, register it in Plesk as your own custom PHP and then compile pthreads module for this PHP.
How to compile and register your compiled PHP is documented. Try to find it.
 
You can try to compile pthreads module for Plesk PHP with something like:

# apt-get install make gcc plesk-php73-dev
# /opt/plesk/php/7.3/bin/pecl install pthreads

and so on, but you will see error:

checking for ZTS... configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled
ERROR: `/tmp/pthreads/configure --with-php-config=/opt/plesk/php/7.3/bin/php-config' failed

The problem in that Plesk PHPs are compiled without ZTS.
But you can compile your own PHP version with ZTS, register it in Plesk as your own custom PHP and then compile pthreads module for this PHP.
How to compile and register your compiled PHP is documented. Try to find it.

I'm now at the recompile step with ZTS but I don't get it..
 
Here is instruction How to add a custom PHP version?
You just need to add --enable-maintainer-zts option for configure.
But note that this is not a trivial task and some additional experiments, configuring and customizations may be required.
 
Back
Top