PHP module mysqli is required .. .. could not find domain's php.ini file

Hi

I am running Virtualmin 6.08, Webmin 1.941 and Usermin 1.791 on Debian Linux 8 running on a VPS with OVH.

I have been experimenting with both the Installatron plugin and the Wordpress script with both the base server and a new virtual server. To get Installatron to work I had to downgrade my PHP version from 7.4 to 7.2. The script works on the base server and I have installed Wordpress instances to both the top level (for the main server) and to public_html (a test instance). The virtual server also appears to have set up properly using the domain name I chose but when I try to install a Wordpress instance to this server get the following error.

PHP module mysqli is required … … could not find domain’s php.ini file

When I look at the PHP options, I think the Apache server is using version 5. Virtualmin for both the main server and the virtual server shows as 7.2. To find the valid file for the current use I used:

php -i | grep “Loaded Configuration File”

which returned;

Loaded Configuration File => /etc/php/7.2/cli/php.ini.

When I look at the file manager under /etc/php i can see that versions 7.0 and 7.10 have both cgi and cli folders, each with a php.ini file. However, versions 7.2, 7.3 and 7.4 only contain a cli folder with the php.ini file in it.

How do I redirect the install script to locate the php.ini file and how do I install the PHP module mysqli that appears to be missing?

Ta in advance.

Geoff

Hi,

How do I redirect the install script to locate the php.ini file?

Those are controlled by a handler in Apache configuration. Virtualmin has a page, called PHP Versions, located at Server Configuration, where you can choose which PHP to use with current virtual-server.

Note: It only works if you have set FPM or (F)CGId as execution mode in Website Options.

How do I install the PHP module mysqli that appears to be missing:

Install it as follows:

apt-get install php-mysql

Note: It can also be PHP version-package specific, like php7.2-mysql, for example.

Privet Ilia!

Thanks for the quick response. mysql was already installed for 7.2 so that was not the problem.

Reset the version for the current domain/server and it installed but still could not find the php.ini file. See here:



PHP module curl is recommended …
… could not find domain’s php.ini file

Configuring webserver PHP settings …
… done

Applying web server configuration …
… done

Now installing WordPress version 5.3.2 …


Does it matter? It appears to have generated a database for the install script.

I will do some testing then post more detail later but thanks again.

Geoff

You should have it set as current version in PHP Versions page. Additionally, I will point out again, that you would need to patch mentioned above file, to make PHP 7.4 detectable by Virtualmin with version 6.08 and below. Upcoming 6.09 will have this working out of the box.

I think, I mis-read the threads, when posting previous reply.

You should also check Server Templates, as default PHP version for new domains is defined there. However, by default it’s set to Highest Available.

For your information, PHP 7 removes mysql extension, leaving only mysqli, or PDO available.

Ilia

I had already set it to 7.2 in the PHP versions page as the default thanks.

I cannot see any mention of the patch which I assume will allow me to leave PHP at 7.4 and work with the script? Could you send the information to me so I can sort it please?

Not sure of the difference between FPM or (F)CGId but I checked and it is set to (F)CGId.

I looked everywhere and searched the net but cannot find a reference to where the Server Template is located. Could you let me know so I can check that as well please? Once that is done I will try again.

Geoff

It’s under System Settings/Server Templates:

Now you have made me look like an idiot! I have no idea how I missed it. Thanks. What about the patch? Do you know when 6.09 is due for release?

It was set to highest so have adjusted it to 7.2.8 and am now going to retry.

Geoff

I can not say for sure, sorry.

I have no idea how I missed it.

… just start typing in search field, to get results:

image

Hi Ilia

I seem to be getting somewhere. I was using the wrong owner (user) and when I changed to the owner of the virtual server, I have been able to install things. I also misunderstood how to set up separate servers and was using a new virtual server instance each time. I am now creating a sub-server and installing the script to that. However, I am still encountering problems with Installatron and wondered if you could help there? It now seems to work as I can see the relvant added domain but eventually it returns this error:

Error
mysql database connection failed:
host = localhost
database = wp1
username = wp1.xorex.perignac
password = HIDDEN
prefix = wp_
errstr = Could not connect to localhost using the username wp1.xorex.perignac and password HIDDEN (mysqli) – [1045] Access denied for user ‘wp1.xorex.perignac’@‘localhost’ (using password: YES)

Any ideas on why?

Geoff

What if you don’t change the user, can Virtualmin login to database then? If so, and you rename the user afterwards, does it fail? There were few bugs reported in this regard.

Can you login to MySQL using console with given credentials?

Not sure as I do not how to do that (log in to mysql using console [ssh connection I assume?])

If I change to my user (admin level) and try to build, it does not see the domain. So I need to use the xorex user account to get Installatron to work. Perhaps xorex has insufficient permissions to create the databases?

Found this instruction

mysql -u USERNAME -p.

I can login with root but not with my credentials or the credentials for site admin user xerox.

Tried with wp1.xorex.perignac but that also could not log in although I assumed it had inherited the password from xorex which may not be right. In the Installatron settings I made xorex the database user and set the password accordingly.

So:

root yes
xorex no
wp1.xorex.perignac no

You can list users with the following command:

mysql> select * from mysql.user;

… if the user exists, you can simply update the password from MySQL cli.

What is your MySQL/MariaDB version?

Hi Ilia

I just want to thank you for your patience and help. I ended up importing the wordpress instance I had generated through virtualmin into Installatron but realised actually, there is nothing in Installatron that is not in virtualmin once you get to know it other than a pretty interface. So, I have decided now I know what I am doing to just rely on Virtualmin and try to build my knowledge as I go.

So with my main server up and running and the subserver also up and running I am turning to my email problems. I will end this post (not sure how to close it off) and submit a new one on the mail server issues.

Thanks again,

Geoff

1 Like

This topic is closed.