I'm setting up a docker container with PHP8 and OCI8. can't seem to figure out why i'm getting error
PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci.so' (tried: /usr/lib/php8/modules/pdo_oci.so (Error loading shared library /usr/lib/php8/modules/pdo_oci.so: No such file or directory), /usr/lib/php8/modules/pdo_oci.so.so (Error loading shared library /usr/lib/php8/modules/pdo_oci.so.so: No such file or directory)) in Unknown on line 0
is there anyway to check the files inside the docker container?
already unzip the Oracle Instant Client, but im now sure its in the directory.
this is my Dockerfile for reference:
FROM composer:2.0 as vendor
COPY composer.json/ /app/composer.json
COPY docker/config/nginx.conf /app/nginx.conf
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--no-ansi \
--prefer-dist
FROM php:8.0-fpm-alpine3.13
LABEL Maintainer="Christian Jay Bayno"
# Install packages
RUN apk --no-cache add php8 \
php8-fpm \
php8-pdo_mysql \
php8-json \
php8-openssl \
php8-curl \
php8-tokenizer \
php8-dom \
php8-dev \
php8-opcache \
nginx \
supervisor \
curl \
git \
tzdata \
g++ \
gcc \
make \
libaio-dev \
libnsl \
gcompat
RUN ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1
# Install Instaclient and PDO OCI
RUN mkdir -p /opt/oci
COPY ./docker/oracle/instantclient-basic-19.17.0.0.0.zip /opt/oci
COPY ./docker/oracle/instantclient-sdk-19.17.0.0.0.zip /opt/oci
COPY ./docker/oracle/pdo_oci.zip /opt/oci
RUN cd /opt/oci \
&& unzip instantclient-basic-19.17.0.0.0.zip \
&& unzip instantclient-sdk-19.17.0.0.0.zip \
&& cd instantclient_19_17/ \
&& ln -s /opt/oci/instantclient_19_17/libclntsh.so.19.1 libclntsh.so \
&& ln -s /opt/oci/instantclient_19_17/libocci.so.19.1 libocci.so \
&& ls \
&& cd ../ \
&& unzip pdo_oci.zip \
&& cd pdo_oci \
&& phpize \
&& ./configure --with-pdo-oci=shared,instantclient,/opt/oci/instantclient_19_17 \
&& make \
&& make install \
&& echo "extension=pdo_oci.so" >> /etc/php8/conf.d/pdo_oci.ini \
&& cd /opt/oci \
&& rm *.zip
# Configure Timezone
ENV TZ Asia/Manila
# Configure nginx
COPY docker/config/nginx.conf /etc/nginx/nginx.conf
# Configure PHP-FPM
COPY docker/config/fpm-pool.conf /etc/php8/php-fpm.d/www.conf
COPY docker/config/php.ini /etc/php8/conf.d/app.ini
# Configure supervisord
COPY docker/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /run && \
chown -R nobody.nobody /var/lib/nginx && \
chown -R nobody.nobody /var/log/nginx
# Set up document root
RUN mkdir -p /var/www/html
# Switch to use a non-root user from here on
USER nobody
# Add application
WORKDIR /var/www/html
COPY --chown=nobody . /var/www/html/
COPY --chown=nobody --from=vendor /app/vendor/ /var/www/html/vendor/
# Expose the port nginx is reachable on
EXPOSE 8085
# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8085/fpm-ping