• 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.

Resolved Problem installing pear extensions with two php version installed

Jose Pinto

New Pleskian
I recently installed php 7.1 for one site and my older sites are using php 5.4.

Here is the problem.
I need to install sqlsrv and pdo_sqlsrv extensions for php. This two extensions only work with php >=7.0 in linux.
But when i run the command "pecl install sqlsrv" the installer takes the older version (5) of php.
After reading in diferent places i found that i can run pecl commands on php7 like this:

"opt/plesk/php/7.1/bin/pecl install sqlsrv"

It works. But i get this error:

"running: phpize5.4
sh: phpize5.4: command not found
ERROR: phpize failed"

I dont know hot to change the pear phpize folder, and i dont know where is the phpize7.1.
I have a CentOS with plesk and I execute the commands using ssh.

Thanks for your help.
 
If you want to compile sqlsrv PHP module for PHP 7.1 version, you should run

# /opt/plesk/php/7.1/bin/pecl install sqlsrv

For PHP 5.4 version run command

# /opt/plesk/php/5.4/bin/pecl install sqlsrv

Note, that packages plesk-php71-devel and plesk-php54-devel should be installed on the server. These packages contain corresponding version of pecl (/opt/plesk/php/7.1/bin/pecl and /opt/plesk/php/7.1/bin/pecl)
 
On ubuntu 16.04 the required package is named: plesk-php71-dev
This will also fix the problem when running
/opt/plesk/php/7.1/bin/pecl install sqlsrv
uses the OS vendor provided PHP and puts the generated module (.so file) in e.g. /usr/lib/php/20151012/ , even though both PECL and PEAR have all correct config variables (ext_dir, php_bin...) - I checked with /opt/plesk/php/7.1/bin/pecl config-get ext_dir
Yeah, I lost half of a sunny Saturday with this.
 
Back
Top