Automatic installation of wordpress upon new virtual server (domain) creation

SYSTEM INFORMATION
OS type and version AlmaLinux 9.4
Virtualmin version 7.20.2

Hi everyone. I’m struggling to understand what’s wrong with the automatic installation of wordpress. The mysqli seems to be installed but virtualmin insists that it’s not and tries to install it unsuccessfully. Any help or advise is appreciated. TIA!

[root@vwm ~]# php -m | grep mysqli
mysqli
[root@vwm ~]#
[root@vwm ~]# php -v
PHP 8.2.23 (cli) (built: Aug 27 2024 15:32:20) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.23, Copyright (c) Zend Technologies
with Zend OPcache v8.2.23, Copyright (c), by Zend Technologies
[root@vwm ~]# httpd -v
Server version: Apache/2.4.57 (AlmaLinux)
Server built: Aug 5 2024 00:00:00
[root@vwm ~]#

This is how i enabled the automatic installation of wordpress.

I notice you are not using the main database. Do you see the same behaviour if you use the main database instead of the other database?

Have you tried it with chroot jail disabled?

Yes, same issue with main database and with chroot jail enabled/disabled. Below is the output of server creation with chroot jail disabled and using main database.

Setting Up Virtual Server
In domain test.com

Saving server details …
… done

Creating administration group test …
… done

Creating administration user test …
… done

Creating aliases for administration user …
… done

Adding administration user to groups …
… done

Creating home directory …
… done

Creating mailbox for administration user …
… done

Adding to email domains list …
… done

Adding default mail aliases …
… done

Adding new virtual website …
… done

Setting up CGI scripts support with FCGIwrap server execution mode …
… done

Adding webserver user apache to server’s group …
… done

Performing other Apache configuration …
… done

Creating SSL certificate and private key …
… done

Adding new SSL virtual website …
… done

Setting up log file rotation …
… done

Creating MariaDB login …
… done

Creating MariaDB database dbtest …
… done

Setting up spam filtering …
… done

Setting up virus filtering …
… done

Setting up AWStats reporting …
… done

Setting up password protection for AWStats …
… done

Creating Webmin user …
… done

Saving server details …
… done

Applying webserver configuration …
… done

Restarting PHP-FPM 8.2 server …
… done

Re-loading Webmin …
… done

Re-starting Usermin …
… done

Restarting mail server …
… done

Updating Webmin user …
… done

Installing third-party web apps …

Installing wordpress version 6.6.1 …
Checking PHP modules …
Installing required PHP mysqli module …
… skipped, not available in repos
… done
Setting up initial SSL certificate …
… keeping self-signed certificate
Creating initial website index page …
… done
Re-loading Webmin …
… done
Restarting PHP-FPM 8.2 server …
… done

You need to find out why the above is happening. Without that there is no chance of a php script connecting to a database. So therefore the script will fail, may be try to install the mysqli module manually and see whatever error your package manager gives.

You think it may be the script failing to connect to the database? I tried reinstalling the php-mysqli but issue remains.

[root@vwm ~]# dnf reinstall php-mysqli
ookla_speedtest-cli 259 B/s | 833 B 00:03
ookla_speedtest-cli-source 272 B/s | 833 B 00:03
Dependencies resolved.

Package Architecture Version Repository Size

Reinstalling:
php-mysqlnd x86_64 8.2.23-1.el9.remi remi-modular 219 k

Transaction Summary

Total download size: 219 k
Installed size: 896 k
Is this ok [y/N]: y
Downloading Packages:
php-mysqlnd-8.2.23-1.el9.remi.x86_64.rpm 371 kB/s | 219 kB 00:00

Total 254 kB/s | 219 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Reinstalling : php-mysqlnd-8.2.23-1.el9.remi.x86_64 1/2
Cleanup : php-mysqlnd-8.2.23-1.el9.remi.x86_64 2/2
Running scriptlet: php-mysqlnd-8.2.23-1.el9.remi.x86_64 2/2
Verifying : php-mysqlnd-8.2.23-1.el9.remi.x86_64 1/2
Verifying : php-mysqlnd-8.2.23-1.el9.remi.x86_64 2/2
Installed products updated.

Reinstalled:
php-mysqlnd-8.2.23-1.el9.remi.x86_64

Complete!
[root@vwm ~]#

I am not familiar with rhel but have you installed more versions of php and if so is your domain setup to use php v 8.2.23 or some other version ? You may need to install the correct php module for the version of php installed. But tbf I just installed wordpress 3 times using different versions of php … all installed correctly, so I am at a loss

There is no issue with wordpress installation script, the issue occurs only with the automatic installation of wordpress on server creation. I can successfully install wordpress manually using the script. I assume it must be something with virtualmin.

I have setup a new VM with fresh virtualmin and installed the php8.2. I cannot reproduce the issue there. It’s working fine. Any clue where to look for to fix the issue on the production VM?

Could it be related to MariaDB Galera? It’s only difference I can think of right now between the production and the new VM.

Have you tried fixing the repo incase its out of date,
sudo virtualmin setup-repos

that php command php -m | grep mysqli failed for me I had to use the version, so try that see if it works as it maybe a version issue with mysqli

I don’t believe that’s related to the problem OP is having. mysqli is not needed on modern systems with modern PHP versions.

Wait. What is actually wrong?

mysqli is not needed. Does the site not work? Are you just worrying about mysqli or is there something else wrong?

@Jamie can this message be made into an informational message instead of looking like an error? Saying it’s “required” is misleading. Heck, it doesn’t even really make sense to try to install it when the modern alternative is available.

have a look at PHP Environment – WordPress.com Support mysqli is still listed, what php module replaces mysqli in modern systems ? apart from using the pdo route

I did try to fix the repo. I only have 1 version of php (8.2).

PDO of course - I can’t believe that WP (and probably some of its plugins/themes) are still using mysqli (thought that went out with PHP 5)

A lot of php apps offer both options (pdo & mysqli) from @Joe 's post this was not made clear

yes I didn’t mean to imply that mysqli was no longer available but more that it is fast going out of use in these days of (OOP) - time it was depreciated.

or you could say why fix something that isn’t broke ?

:man_shrugging: man_shrugging: quote=“jimr1, post:19, topic:128886”]
or you could say why fix something that isn’t broke ?
[/quote]

could say that about just about everything - but the world progresses
(so they say) :man_shrugging: