PHP extension not loaded

SYSTEM INFORMATION
OS type and version UBUNTU 24.04
Virtualmin version 7.30.8

I have a rather weird problem with the webmin/virtualmin environment. I needed php extension=oci8 loaded, i installed it through ssh terminal up until its detected with php -m. However, when i try to run php -m in the webmin/virtualmin terminal, it shows unable to load dynamic library error pointing to oci8. the php version is 8.3 and the extension was set in the php ini yet not detected within webmin/virtualmin environment but works fine when i go through ssh. is there anything i missed? I am new to virtualmin.

How are you installing it, more info would be good.

I tried the normal way to install a php module via the package manager but I got a error on Rocky 9.

root@server:~# dnf install php83-php-oci8
Last metadata expiration check: 3:34:18 ago on Thu 03 Apr 2025 04:12:25 PM AEST.
Error: 
 Problem: cannot install the best candidate for the job
  - nothing provides libclntsh.so.23.1()(64bit) needed by php83-php-oci8-8.3.19-1.el9.remi.x86_64 from remi-safe
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Seeing you are on Ubuntu try

apt-get install php8.3-oci8

Reference Configuring Multiple PHP Versions | Virtualmin — Open Source Web Hosting Control Panel

1 Like

The Webmin / Virtualmin terminal invokes the default version of PHP. However, you get to choose which version of PHP is used within Virtualmin’s virtual server (or even a version of PHP on a per directory basis) so you need to be clear about which version of PHP is being invoked - obviously the extensions available to you will vary accordingly.

See

3 Likes

Sounds like Webmin is using a different PHP version or config. Double-check the PHP version it’s tied to in Virtualmin > PHP Versions.

We’re talking about the Terminal, which is not related to anything Webmin/Virtualmin have configured. php will be the system default PHP version. There will be php83 or similar commands for other versions, or you have a variety of options for making a different version the default when running php (aliases, wrapper scripts, etc.). But, what happens in the terminal has nothing to do with Webmin or Virtualmin.

1 Like

Got it—thanks for the clarification. Maybe double-check if the terminal inside Webmin is using a restricted shell or PATH?

A bit late but thank you for the response. Nice to know that it can be configured.

I tried and still same, the issue is that in php_info through other methods(fpm) does show the oci installed however im using that extension through cli. In my case it is not loaded for cli.

Is that extension available for the cli version of php ? Tbf never used it, there is the thought that it’s no available for cli, if so you can code around that limitation using file_get_contents and parsing the output

It is available. As a temporary solution, i had to run manually, getting into the server through ssh. That way it did work however not with Webmin/Virtualmin terminal. I havent tried it but i think this might solve the issue:

Would it help to chroot the domain so that it only sees the ‘correct’ version of php for the cli?

That reminds me virtualmin adds a link to php ini concurrent to the version of php selected for the domain, so you may have extensions installed on 8.3 but if the domain version of php is different it will fail as the extension for that version of maybe not installed, running as root can cloud the issue as the version of php for root maybe different. I noted this point some years ago but I guess it was ignored like most of the stuff I say :zipper_mouth_face: