Issue on installing pthread

returnedx

Verified User
Joined
Sep 26, 2019
Messages
7
Hello guys,

I bumped into a "mayor" issue... Can't seems to get pthreads installed.
Tried a lot of things and tuts (but most are on centos WITHOUT directadmin's custom build).
On my DA I have multiple PHP versions. I've selected " PHP 7.4 php-fpm ".

I get this error:

Code:
[root@s2 ~]# pecl install pthreads
WARNING: "pecl/pthreads" is deprecated in favor of "channel:///parallel"
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading pthreads-3.1.6.tgz ...
Starting to download pthreads-3.1.6.tgz (80,932 bytes)
...................done: 80,932 bytes
28 source files, building
running: phpize74
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
shtool at '/tmp/pear/temp/pthreads/build/shtool' does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.

ERROR: `phpize' failed
[root@s2 ~]#

What am I doing wrong?

Setup:
Centos 7.9.2009
DirectAdmin 1.61.5
 

Attachments

It deprecated with pecl-channel now, You need to manual install.

Example,
Code:
cd /usr/local/src
wget https://github.com/krakjoe/pthreads/archive/v3.2.0.tar.gz
tar -xzvf pthreads-3.2.0.tar.gz
cd pthreads-3.2.0
/usr/local/php74/bin/phpize
./configure --with-php-config=/usr/local/php74/bin/php-config
make
make install
 
It deprecated with pecl-channel now, You need to manual install.

Example,
Code:
cd /usr/local/src
wget https://github.com/krakjoe/pthreads/archive/v3.2.0.tar.gz
tar -xzvf pthreads-3.2.0.tar.gz
cd pthreads-3.2.0
/usr/local/php74/bin/phpize
./configure --with-php-config=/usr/local/php74/bin/php-config
make
make install
Thanks for the info, but I get an error at "make"
 

Attachments

  • Schermafbeelding 2021-03-12 om 13.43.21.png
    Schermafbeelding 2021-03-12 om 13.43.21.png
    139.4 KB · Views: 5
How do I check that and fix it?
I found it: mount -o remount,exec /tmp .
It brought me further now, parallel could be installed, but pthreads gave the following error:
Code:
./src/copy.h:346:10: error: ‘zend_op_array’ has no member named ‘run_time_cache’
  op_array->run_time_cache = NULL;
          ^
/usr/local/src/pthreads-3.2.0/php_pthreads.c: In functie ‘zm_startup_pthreads’:
/usr/local/src/pthreads-3.2.0/php_pthreads.c:750:16: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
  zend_handlers = zend_get_std_object_handlers();
                ^
/usr/local/src/pthreads-3.2.0/php_pthreads.c:764:35: warning: assignment from incompatible pointer type [enabled by default]
  pthreads_handlers.write_property = pthreads_write_property;
                                   ^
/usr/local/src/pthreads-3.2.0/php_pthreads.c:788:42: warning: assignment from incompatible pointer type [enabled by default]
  pthreads_socket_handlers.write_property = pthreads_write_property_disallow;
                                          ^
make: *** [php_pthreads.lo] Error 1
 
I found it: mount -o remount,exec /tmp .
It brought me further now, parallel could be installed, but pthreads gave the following error:
Code:
./src/copy.h:346:10: error: ‘zend_op_array’ has no member named ‘run_time_cache’
  op_array->run_time_cache = NULL;
          ^
/usr/local/src/pthreads-3.2.0/php_pthreads.c: In functie ‘zm_startup_pthreads’:
/usr/local/src/pthreads-3.2.0/php_pthreads.c:750:16: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
  zend_handlers = zend_get_std_object_handlers();
                ^
/usr/local/src/pthreads-3.2.0/php_pthreads.c:764:35: warning: assignment from incompatible pointer type [enabled by default]
  pthreads_handlers.write_property = pthreads_write_property;
                                   ^
/usr/local/src/pthreads-3.2.0/php_pthreads.c:788:42: warning: assignment from incompatible pointer type [enabled by default]
  pthreads_socket_handlers.write_property = pthreads_write_property_disallow;
                                          ^
make: *** [php_pthreads.lo] Error 1
Yeh, It's starting new work called " parallel " after php7.4


Besure you should install by manual to get new release version.
 
Yeh, It's starting new work called " parallel " after php7.4

Besure you should install by manual to get new release version.
Strange thing is that "parallel" requires "pthreads".
So, not installing pthreads doesn't seems to be an option.
I tried to install pthreads with the commands given by you above.
 
Code:
Requirements

[*]PHP 7.2+
[*]ZTS Enabled ( Thread Safety )
[*]Posix Threads Implementation

I think, you miss ZTS Enable
It need to rebuild php with ZTS Enable

Code:
--enable-maintainer-zts
 
Code:
Requirements

[*]PHP 7.2+
[*]ZTS Enabled ( Thread Safety )
[*]Posix Threads Implementation

I think, you miss ZTS Enable
It need to rebuild php with ZTS Enable

Code:
--enable-maintainer-zts
As you see in the phpinfo, ZTS is enabled.
But...
holy sh*t, I feel stupid now...
Parallel is working, but I forgot that my website is running on 2 servers in load balancer... I was fixed to server A, when I installed parallel on server B.
 
Back
Top