• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue PHP extension problem for multiple PHP versions

John S.

New Pleskian
I cannot add PHP extensions for any version higher than 5.4. This is the problem I am experiencing, step-by-step:

1. Switch to PHP 5.5.38 in Domain->PHP Settings
2. Add a few installed extensions to the 'Additional configuration directives ' on PHP settings page, e.g.
extension=stats.so
extension=trader.so
expose_php = Off
extension=apc.so
3. Save it, then reconfigure the domain, restart httpd and nginx.
4. These added extensions appear in php.ini in
/var/www/vhosts/system/mydomaincom/etc
5. But nothing works, these extensions are not shown in phpinfo() and not enabled.
6. I also tried adding these directive directly to master php.ini in
/opt/plesk/php/5.5/etc
--- the same issue, it doesn't work. I tried both FPM and FastCGI

The same scenario works perfectly find for PHP 5.4.

Pls help.

Thanks!
 
PHP extensions should be enabled in Tools&Settings>PHP Settings>PHPxx
 
PHP extensions should be enabled in Tools&Settings>PHP Settings>PHPxx
I don't see any extensions I installed via pecl in Tools&Settings>PHP Settings>PHPxx[

I installed them directly via ssh. They are shown on php command line (#php -m) and can be enabled for PHP 5.4.45. For all other higher versions it doesn't work.

I also tried to add:

Code:
extension_dir=/usr/lib64/php/modules

but it also doesn't enable these extensions
 
Here a lot of instructions how to compile different php modules for different Plesk php versions, try to find them and compare with your method. For example Resolved - memcache 3.0.8 for PHP 5.6 on Ubuntu 16.04
Thanks - I am trying to it as you suggested and this is the output:
Code:
# /opt/plesk/php/5.5/bin/pecl install trader

Warning: Invalid argument supplied for foreach() in PEAR/Downloader.php on line 573
PHP Warning:  Invalid argument supplied for foreach() in /opt/plesk/php/5.5/share/pear/PEAR/Downloader.php on line 573
downloading trader-0.5.0.tgz ...
Starting to download trader-0.5.0.tgz (299,829 bytes)
.............................................................done: 299,829 bytes

Warning: Invalid argument supplied for foreach() in PEAR/PackageFile/v2/Validator.php on line 870
PHP Warning:  Invalid argument supplied for foreach() in /opt/plesk/php/5.5/share/pear/PEAR/PackageFile/v2/Validator.php
 on line 870
332 source files, building
WARNING: php_bin /opt/plesk/php/5.5/bin/php appears to have a suffix /5.5/bin/php, but config variable php_suffix does n
ot match
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
shtool at '/tmp/trader/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
 
This is another out for stats pecl extension:

Code:
# /opt/plesk/php/5.5/bin/pecl install stats
downloading stats-1.0.5.tgz ...
Starting to download stats-1.0.5.tgz (112,361 bytes)
.........................done: 112,361 bytes
17 source files, building
WARNING: php_bin /opt/plesk/php/5.5/bin/php appears to have a suffix /5.5/bin/php, but config variable php_suffix does n
ot match
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
shtool at '/tmp/stats/build/shtool' does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.

Any suggestions?
 
No any problem with trader installation for me with

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

And check finally:

# /opt/plesk/php/5.5/bin/php -m | grep trader
trader
 
With the same method:

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

:)
 
I have managed to install all extensions except APC. It returns the following error at the end, after a long cmpile code:

Code:
#/opt/plesk/php/5.5/bin/pecl install apc
.....................................
......................................
.....................................
.....................................
/root/tmp/APC/apc_compile.c: In function ƒmy_copy_class_entryƒ:
/root/tmp/APC/apc_compile.c:755: warning: assignment from incompatible pointer type
/root/tmp/APC/apc_compile.c: In function ƒapc_copy_class_entry_for_executionƒ:
/root/tmp/APC/apc_compile.c:1956: warning: assignment from incompatible pointer type
/root/tmp/APC/apc_compile.c: In function ƒapc_copy_trait_aliasƒ:
/root/tmp/APC/apc_compile.c:2379: error: ƒzend_trait_aliasƒ has no member named ƒfunctionƒ
/root/tmp/APC/apc_compile.c:2380: error: ƒzend_trait_aliasƒ has no member named ƒfunctionƒ
/root/tmp/APC/apc_compile.c:2380: error: ƒzend_trait_aliasƒ has no member named ƒfunctionƒ
/root/tmp/APC/apc_compile.c: In function ƒapc_copy_trait_precedenceƒ:
/root/tmp/APC/apc_compile.c:2416: error: ƒzend_trait_precedenceƒ has no member named ƒfunctionƒ
/root/tmp/APC/apc_compile.c:2417: error: ƒzend_trait_precedenceƒ has no member named ƒfunctionƒ
/root/tmp/APC/apc_compile.c:2417: error: ƒzend_trait_precedenceƒ has no member named ƒfunctionƒ
make: *** [apc_compile.lo] Error 1
ERROR: `make' failed

Any suggestions how to fix it?
 
BTW, PHP 5.5 has built-in opcode optimizer OPcache making APC obsolete.
According to APC changelogs, PHP up to only 5.4 is supported.
 
Back
Top