adrianharabula / php-oci8

Official Docker PHP image with Oracle Instant Client and OCI8
https://hub.docker.com/r/adrianharabula/php7-with-oci8
27 stars 34 forks source link

Fatal error: Uncaught Error: Call to undefined function oci_connect() in /var/www/html/ocitest.php:3 Stack trace: #0 {main} thrown in /var/www/html/ocitest.php on line 3 #7

Closed flik closed 7 months ago

flik commented 5 years ago

php file:

<?php

$conn = oci_connect('system', 'oracle', 'oracledb/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
} else echo 'succesful';

here is docker-compose.yml:

version: '3'

services:
   oracledb:
     image: wnameless/oracle-xe-11g
     ports:
      - "1521:1521"

   php7-with-oci8:
     depends_on:
       - oracledb
     image: adrianharabula/php7-with-oci8
     build:
        context: .
        dockerfile: ./php72/Dockerfile
     volumes:
      - ./www:/var/www/html
     ports:
      - "8181:80"
adrianharabula commented 5 years ago

Hello,

If you rebuilt the image by yourself, it looks like using latest php 7.1 apache image won't work.

Modified the Dockerfile to rebuild a working image with php:7.1.16-apache-jessie and oci-2.1.8. Here are the changes: bbd3cf42bc8d5dbfb84d5f92c800bc3519764530

adrianharabula commented 5 years ago

Fix in the commit above, now it works with latest php:7.1.30 also.

adrianharabula commented 7 months ago

I am closing this @flik . Feel free to reopen another issue if needed. You can check latest php82 build with oci8 https://github.com/adrianharabula/php-oci8/commit/1bb63cc042e30da722fe13d125d9e2a2713a65df