Closed
Description
I have an error when I use "FROM php:8.1-apache" and try to install oci8 for oracle.
I follow these steps;
- download from oracle https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-basic-linux.x64-21.6.0.0.0dbru.zip and https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-sdk-linux.x64-21.6.0.0.0dbru.zip
- unzip instantclient-basic-linux.x64-21.6.0.0.0dbru.zip and instantclient-sdk-linux.x64-21.6.0.0.0dbru.zip in folder /opt/oracle/instantclient
- launch command
echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8-3.2.1
After this command there is an error: Fatal error: Uncaught Error: Call to undefined function exec() in /usr/local/lib/php/PEAR/Builder.php:465
[...]
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1" install
Installing shared extensions: /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local/lib/php/extensions/no-debug-non-zts-20210902/
running: find "/tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1" | xargs ls -dils
4719924 4 drwxr-xr-x 3 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1
4719961 4 drwxr-xr-x 3 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr
4719962 4 drwxr-xr-x 3 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local
4719963 4 drwxr-xr-x 3 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local/lib
4719964 4 drwxr-xr-x 3 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local/lib/php
4719965 4 drwxr-xr-x 3 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local/lib/php/extensions
4719966 4 drwxr-xr-x 2 root root 4096 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local/lib/php/extensions/no-debug-non-zts-20210902
4719960 828 -rwxr-xr-x 1 root root 844024 Jul 25 14:36 /tmp/pear/temp/pear-build-defaultuservlzPxQ/install-oci8-3.2.1/usr/local/lib/php/extensions/no-debug-non-zts-20210902/oci8.so
Fatal error: Uncaught Error: Call to undefined function exec() in /usr/local/lib/php/PEAR/Builder.php:465
Stack trace:
#0 /usr/local/lib/php/PEAR/Installer.php(1521): PEAR_Builder->build('/tmp/pear/temp/...', Array)
#1 /usr/local/lib/php/PEAR/Installer.php(1416): PEAR_Installer->_compileSourceFiles('pecl.php.net', Object(PEAR_PackageFile_v2), '')
#2 /usr/local/lib/php/PEAR/Command/Install.php(718): PEAR_Installer->install('/tmp/pear/downl...', Array)
#3 /usr/local/lib/php/PEAR/Command/Common.php(270): PEAR_Command_Install->doInstall('install', Array, Array)
#4 /usr/local/lib/php/pearcmd.php(310): PEAR_Command_Common->run('install', Array, Array)
#5 /usr/local/lib/php/peclcmd.php(32): require_once('/usr/local/lib/...')
#6 {main}
thrown in /usr/local/lib/php/PEAR/Builder.php on line 465
The same command with php7.4-apache echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8-2.2.0
works.