• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Installing php pecl extensions for different php versions

John S.

New Pleskian
Hello everybody,

I am trying to install pecl stats extension for php 7.2, in adition to php 5.4.45. The default server php version is 5.4.45 and I have installed stats v. 1.0.5.

I tried calling the pecl of php 7.2. as
Code:
/opt/plesk/php/7.2/bin/pecl install stats-2.0.2

it throws hundreds of errors like the following:
Code:
/usr/include/php/Zend/zend_operators.h:400:36: note: in expansion of macro ƒconvert_to_ex_masterƒ
 #define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE)
                                    ^~~~~~~~~~~~~~~~~~~~
/tmp/stats/php_stats.c:3684:3: note: in expansion of macro ƒconvert_to_double_exƒ
   convert_to_double_ex(entry);
   ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/php/main/php.h:34:0,
                 from /tmp/stats/php_stats.c:26:
/usr/include/php/Zend/zend.h:767:12: error: incompatible types when assigning to type ƒzval {aka struct _zval_struct}ƒ from type ƒzval * {aka s
truct _zval_struct *}ƒ
    *(ppzv) = new_zv;     \
            ^
/usr/include/php/Zend/zend.h:774:3: note: in expansion of macro ƒSEPARATE_ZVALƒ
   SEPARATE_ZVAL(ppzv);    \
   ^~~~~~~~~~~~~
/usr/include/php/Zend/zend_operators.h:358:3: note: in expansion of macro ƒSEPARATE_ZVAL_IF_NOT_REFƒ
   SEPARATE_ZVAL_IF_NOT_REF(ppzv);      \
   ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_operators.h:400:36: note: in expansion of macro ƒconvert_to_ex_masterƒ
 #define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE)
                                    ^~~~~~~~~~~~~~~~~~~~
/tmp/stats/php_stats.c:3684:3: note: in expansion of macro ƒconvert_to_double_exƒ
   convert_to_double_ex(entry);
   ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/php/Zend/zend.h:830:0,
                 from /usr/include/php/main/php.h:34,
                 from /tmp/stats/php_stats.c:26:
/usr/include/php/Zend/zend_operators.h:359:27: error: incompatible type for argument 1 of ƒconvert_to_doubleƒ
   convert_to_##lower_type(*ppzv);      \
                           ^
/usr/include/php/Zend/zend_operators.h:400:36: note: in expansion of macro ƒconvert_to_ex_masterƒ
 #define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE)
                                    ^~~~~~~~~~~~~~~~~~~~
/tmp/stats/php_stats.c:3684:3: note: in expansion of macro ƒconvert_to_double_exƒ
   convert_to_double_ex(entry);

I can install other pecl extensions for php 7.2 (e.g. trader), only stats causes the problem for php 7.2.

PHP and pecl versions:

Code:
# /opt/plesk/php/7.2/bin/pecl version
PEAR Version: 1.10.5
PHP Version: 7.2.13
Zend Engine Version: 3.2.0
Running on: Linux xxx.com 2.6.32-754.6.3.el6.x86_64 #1 SMP Tue Oct 9 17:27:49 UTC 2018 x86_64

# pecl version
PEAR Version: 1.9.4
PHP Version: 5.4.45
Zend Engine Version: 2.4.0
Running on: Linux xxx.com 2.6.32-754.6.3.el6.x86_64 #1 SMP Tue Oct 9 17:27:49 UTC 2018 x86_64

Any suggestions how to fix it? I have to keep both php 5.4.45 and 7.2 due to incompatibility of some applications.

Thanks!
 
Last edited:
@John S.

Please try to install package version 2.0.3, the older and buggy version 2.0.2 has been replaced for many years now.

Note that this newer version will not guarantee compatibility, since the release date of 2.0.3 was a staggering 2016-06-02.

Nevertheless, you can expect less problems and you can at least give it a try.

Finally, note that is certainly not recommended to keep PHP versions 5.6.x and older, since that is a huge security risk for your entire server and/or server infrastructure.

Hope the above helps a bit.

Regards........
 
@John S.

Please try to install package version 2.0.3, the older and buggy version 2.0.2 has been replaced for many years now.

Thsnk you for the advice. I tried all 2.0.* versions - the same errors. I also tried to build stats.so from the source, but it required phpize for 7.2... I am afraid that if I install php-devel for 7.2, it will overwrite php-devel 5.4 - I am not sure if there is backward compatibility of php-devel.
 
I see no problems with stats compiling:

# yum install plesk-php72-devel make gcc
# /opt/plesk/php/7.2/bin/pecl install stats-2.0.3
# echo "extension=stats.so" > /opt/plesk/php/7.2/etc/php.d/stats.ini
# /usr/local/psa/bin/php_handler --reread

and finally:

# /opt/plesk/php/7.2/bin/php -m | grep stats

stats
 
I see no problems with stats compiling:

# yum install plesk-php72-devel make gcc
# /opt/plesk/php/7.2/bin/pecl install stats-2.0.3
# echo "extension=stats.so" > /opt/plesk/php/7.2/etc/php.d/stats.ini
# /usr/local/psa/bin/php_handler --reread

and finally:

# /opt/plesk/php/7.2/bin/php -m | grep stats

stats
Thank you, Igor! It works prefectly. I didn't know that I could install multiple php-devel like plesk-php72-devel.
 
Back
Top