{"id":2264,"date":"2022-11-17T14:12:28","date_gmt":"2022-11-17T13:12:28","guid":{"rendered":"https:\/\/www.speich.net\/articles\/?p=2264"},"modified":"2022-11-17T14:12:29","modified_gmt":"2022-11-17T13:12:29","slug":"multiple-oci8-and-php-versions-in-parallel","status":"publish","type":"post","link":"https:\/\/www.speich.net\/articles\/en\/2022\/11\/17\/multiple-oci8-and-php-versions-in-parallel\/","title":{"rendered":"Multiple OCI8 and PHP versions in parallel"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can easily switch between multiple versions of PHP with:<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo a2disconf php8.1-fpm\nsudo a2enconf php8.0-fpm\nsudo systemctl reload apache2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">But if you installed the Oracle oci8 extension, you will probably run into the error, that it can not be loaded when switching to the older php version: <code>Unable to load dynamic library 'oci8.so'<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This happens, because pecl uninstalls the previous oci8 version automatically unless you explicitly say not to do so when installing:<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code># NOTE: PECL removes \/usr\/lib\/php\/xyz\/oci8.so from non-active php versions,\n# if you want multiple installations of php with oci8 in parallel, you need to set the php_suffix and prevent other oci8 version from being uninstalled with:\nsudo pecl -d php_suffix=8.1 install oci8; sudo pecl uninstall -r oci8\nsudo pecl -d php_suffix=8.0 install oci8-3.0.1; sudo pecl uninstall -r oci8\n\n# instead of just installing latest version with\nsudo pecl install oci8<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can easily switch between multiple versions of PHP with: But if you installed the Oracle oci8 extension, you will probably run into the error, that it can not be loaded when switching to the older php version: Unable to load dynamic library &#8216;oci8.so&#8217; This happens, because pecl uninstalls the previous oci8 version automatically unless &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.speich.net\/articles\/en\/2022\/11\/17\/multiple-oci8-and-php-versions-in-parallel\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Multiple OCI8 and PHP versions in parallel&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[68,333,335],"class_list":["post-2264","post","type-post","status-publish","format-standard","hentry","category-php","tag-oci","tag-oci8","tag-pecl","entry"],"_links":{"self":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/comments?post=2264"}],"version-history":[{"count":7,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2264\/revisions"}],"predecessor-version":[{"id":2271,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2264\/revisions\/2271"}],"wp:attachment":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/media?parent=2264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/categories?post=2264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/tags?post=2264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}