Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5962

How to build same php extension for multiple versions on the same server with Ubuntu?

$
0
0

I have a server with Ubuntu 22.04 that has multiple versions of PHP installed using ondrej:ppa. I need to add oci8 extension to all supported versions. This is the procedure that I have been using:

phpver='7.4'builddir="/build$phpver"instpath='/opt/oracle/instantclient_21_12'[ "$phpver" = '7.4' ] && oci8version='oci8-2.2.0'[ "$phpver" = '8.0' ] && oci8version='oci8-3.0.1'update-alternatives --set php "/usr/bin/php${phpver}" && \update-alternatives --set phpize "/usr/bin/phpize${phpver}" && \update-alternatives --set php-config "/usr/bin/php-config${phpver}" && \rm -f "/etc/php/${phpver}/mods-available/oci8.ini" && \touch "/etc/php/${phpver}/mods-available/oci8.ini" && \pear config-set php_ini "/etc/php/${phpver}/mods-available/oci8.ini" && \mkdir -pv "$builddir" && \pear config-set temp_dir "$builddir" && \pecl install -f --configureoptions "with-oci8=\"instantclient,$instpath\"" "$oci8version" && \phpenmod -v "${phpver}" oci8pear config-set php_ini ''pear config-set temp_dir ''rm -rf "$builddir"

Executing this for one version of PHP everything is fine. When I try to execute for a different version of php the extension also builds fine but the extension for previously used version of php is deleted???

I am obviously doing something wrong here.


Viewing all articles
Browse latest Browse all 5962

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>