• 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

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