{"id":2834,"date":"2026-05-31T11:21:24","date_gmt":"2026-05-31T09:21:24","guid":{"rendered":"https:\/\/www.speich.net\/articles\/?p=2834"},"modified":"2026-05-31T11:29:13","modified_gmt":"2026-05-31T09:29:13","slug":"frankenphp-install-oci8-using-pie","status":"publish","type":"post","link":"https:\/\/www.speich.net\/articles\/en\/2026\/05\/31\/frankenphp-install-oci8-using-pie\/","title":{"rendered":"FrankenPHP: Install OCI8 using PIE"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is the Dockerfile to install OCI8 in <a href=\"https:\/\/frankenphp.dev\/\" target=\"_blank\" rel=\"noreferrer noopener\">FrankenPHP<\/a> using the new official installer for PHP extensions <a href=\"https:\/\/github.com\/php\/pie\" target=\"_blank\" rel=\"noreferrer noopener\">PIE<\/a>, which replaces <a href=\"https:\/\/pecl.php.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">PECL<\/a> (deprecated now). The recipe can be easily adapted for any docker installation of PHP OCI8 using PIE:<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code># Start with the official FrankenPHP image \nFROM dunglas\/frankenphp:1-php8.5\n\n# 1. Install system utilities and the AIO library required by Oracle\nRUN apt-get update &amp;&amp; apt-get install -y \\\n    unzip \\\n    libaio1t64 \\\n    curl \\\n    build-essential \\\n    libtool \\\n    &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*\n\n# Fix the Oracle Y2038 compatibility break by symlinking the new t64 library to the old name\nRUN ln -s \/usr\/lib\/x86_64-linux-gnu\/libaio.so.1t64 \/usr\/lib\/x86_64-linux-gnu\/libaio.so.1\n\n# 2. Set up the Oracle Instant Client\nWORKDIR \/opt\/oracle\nRUN curl -o instantclient-basic.zip https:\/\/download.oracle.com\/otn_software\/linux\/instantclient\/2112000\/instantclient-basic-linux.x64-21.12.0.0.0dbru.zip \\\n    &amp;&amp; curl -o instantclient-sdk.zip https:\/\/download.oracle.com\/otn_software\/linux\/instantclient\/2112000\/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip \\\n    &amp;&amp; unzip instantclient-basic.zip \\\n    &amp;&amp; unzip instantclient-sdk.zip \\\n    &amp;&amp; rm -f *.zip\n\n# Set environment variables so PHP knows where Oracle lives\nENV LD_LIBRARY_PATH=\/opt\/oracle\/instantclient_21_12\nENV ORACLE_HOME=\/opt\/oracle\/instantclient_21_12\n\n# 3. Compile the custom OCI8 extension against the Instant Client via PIE\n# Download the PIE executable from the PHP Foundation\nRUN curl -fL --output \/usr\/local\/bin\/pie https:\/\/github.com\/php\/pie\/releases\/latest\/download\/pie.phar \\\n    &amp;&amp; chmod +x \/usr\/local\/bin\/pie\n\n# Install OCI8 via PIE by passing the configure flag directly\nRUN pie install oci8\/oci8 --with-oci8=instantclient,\/opt\/oracle\/instantclient_21_12 \\\n    &amp;&amp; docker-php-ext-enable oci8\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the Dockerfile to install OCI8 in FrankenPHP using the new official installer for PHP extensions PIE, which replaces PECL (deprecated now). The recipe can be easily adapted for any docker installation of PHP OCI8 using PIE:<\/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":[],"class_list":["post-2834","post","type-post","status-publish","format-standard","hentry","category-php","entry"],"_links":{"self":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2834","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=2834"}],"version-history":[{"count":2,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2834\/revisions"}],"predecessor-version":[{"id":2837,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2834\/revisions\/2837"}],"wp:attachment":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/media?parent=2834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/categories?post=2834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/tags?post=2834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}