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)
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.
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.
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:
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