Ubuntu 24.04 PHP 8.3 OCI8 and libaio.so.1


PHP Warning:  PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib/php/20230831/oci8 (/usr/lib/php/20230831/oci8: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/oci8.so (libaio.so.1: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.3.6 (cli) (built: Apr 15 2024 19:21:47) (NTS)

I installed the Oracle Instant Client and OCI8 but it seems libaio.so.1 is not installed. I see libaio1t64 is installed.

Is there a way to link that to libaio.so.1?

ldd /usr/lib/php/20230831/oci8.so
    linux-vdso.so.1 (0x00007ffeebd3f000)
    libclntsh.so.12.1 => /opt/oracle/instantclient_12_2/libclntsh.so.12.1 (0x00007f4d1fe00000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4d1fa00000)
    libmql1.so => /opt/oracle/instantclient_12_2/libmql1.so (0x00007f4d1f400000)
    libipc1.so => /opt/oracle/instantclient_12_2/libipc1.so (0x00007f4d1ec00000)
    libnnz12.so => /opt/oracle/instantclient_12_2/libnnz12.so (0x00007f4d1e200000)
    libons.so => /opt/oracle/instantclient_12_2/libons.so (0x00007f4d1dc00000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4d23b33000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4d23a4a000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4d23a45000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f4d23a29000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4d23a24000)
    libaio.so.1 => not found
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f4d23a0f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f4d23b73000)
    libclntshcore.so.12.1 => /opt/oracle/instantclient_12_2/libclntshcore.so.12.1 (0x00007f4d1d400000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4d239e2000)
    libaio.so.1 => not found

Best Answer

The package and the library have been renamed in 24.04. The package name now is libaio1t64 and the library is available as libaio.so.1t64.

I have created a symlink. Now the module is at least loaded without an error:

ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
Related Question