"PHP module mysql is required .... could not find global php.ini file" using Wordpress Install Script

18 posts / 0 new
Last post
#1 Sun, 05/06/2018 - 19:44
richb-hanover

"PHP module mysql is required .... could not find global php.ini file" using Wordpress Install Script

When using the Wordpress install script I get the message:

"PHP module mysql is required .... could not find global php.ini file"

Here are details:

  • I use Create Virtual Server to create a new server. This seems to work fine.
  • I then use Install Scripts to select and install Wordpress (default - 4.9.5) and when I click "Install" I get that message.
  • The host came with PHP 5.5.9 installed, and i installed PHP 7.0.30 manually. (Other WP sites on this server wind up using PHP 5.5.9)
  • I'm using Virtualmin 6.03, Webmin 1.881 on a Ubuntu 14.04 VPS.
  • Using the manual Wordpress "5 minute" install with another site on this server works fine.
  • Software Versions shows:
  Operating system Ubuntu Linux 14.04.3
  Perl version 5.018002
  Path to Perl /usr/bin/perl
  BIND version 9.9
  Postfix version 2.7.0
  Mail injection command /usr/lib/sendmail -t
  Apache version 2.4.7
  PHP versions 5.5.9, 7.0.30
  Logrotate version 3.8.7
  MySQL version 5.5.60-0ubuntu0.14.04.1
 

Thoughts on debugging this? What other information could I provide? Thanks.

Wed, 06/13/2018 - 18:19
mxgroup

Hi, I have the same error message! Any update on this? Maybe because I installed PHP 7.2 on my Ubuntu 16.04 machine? I has 7.0 installed by default. Maybe because of this it can not find the php.ini file?

Operating system Ubuntu Linux 16.04.4
Webmin version 1.883
Usermin version 1.741
Virtualmin version 6.03
Kernel and CPU Linux 4.4.0-119-generic on x86_64
Apache version 2.4.18
PHP versions 7.2.5
MySQL version 5.7.22-0ubuntu0.16.04.1
Thu, 06/14/2018 - 08:26
Diabolico
Diabolico's picture

Did you guys check what modules are loaded to actually see if mysql is missing or not?

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Thu, 06/14/2018 - 09:12
richb-hanover

Thanks for this response. Sorry for the newbie question (I'm new to WP admin - I'm very comfortable with SSH'ing into hosts...)

What's a good way to check if mysql is missing/present? Thanks.

Thu, 06/14/2018 - 13:52
richb-hanover

One more thought: I have successfully installed Wordpress several times on the very same host by downloading the WP install file and using the famous 5-minute procedure... It works without complaint: what's different between the standard WP install process and the Virtualmin Install Scripts... Thanks!

Thu, 06/14/2018 - 15:42
mxgroup

Hello, I have multiple Wordpress/WooCommerce sites running on my server, no issues. All is fine. Just most of the script do not install. Actually the squirrelmail script did install. But, the others (Wordpress, SquirrelMail..) do not install. I tried installing different versions, and tried installing while logged in as main administrator and as a virtual server account, but all show the same error message. Are there any log files I can send you to help? I am really very, very impressed with Webmin/Virtualmin! I am using it on my self managed servers, and it is great!

Fri, 06/15/2018 - 19:24
Diabolico
Diabolico's picture

To check loaded PHP modules connect with SSH and run php -m and if you need to do the same with Apache then use apache2ctl -M for Ubuntu or for Centos apachectl -M (apachectl -M | sort for the list in alphabetical order).

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sat, 06/16/2018 - 09:28
richb-hanover

Thanks for the tip. I have placed the output of the php -m and apache2ctl -M commands on pastebin at https://pastebin.com/aZSw1Vkb What would be my next step(s)? Thanks.

Update: I added the list of php.ini files in /etc/ to the pastebin page

Update: I added info from phpinfo() call to the pastebin at https://pastebin.com/aZSw1Vkb

Sun, 06/17/2018 - 06:04
Diabolico
Diabolico's picture

Based on your output i dont see anything missing in PHP modules. You should check your php.ini files in /etc and /home and see if they are missing or with wrong settings. But based on the error message i would suspect something is wrong with php.ini located in /etc.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sun, 06/17/2018 - 06:58
richb-hanover

Ahah! I think you've put your finger on it. The pastebin shows there are several php.ini files nested in /etc - /etc/php5/cli/php.ini /etc/php5/apache2/php.ini /etc/php/7.0/cli/php.ini /etc/php/7.0/apache2/php.ini

BUT... /home/myuserid/etc is empty!

I suspect I could simply copy one of the php.ini files from /etc, but which one?

(And if I could further impose on your knowledge and generosity, how do I tell the WP install to use php 7.0, not php5?) Thanks!

Sun, 06/17/2018 - 17:05
Diabolico
Diabolico's picture

I suspect I could simply copy one of the php.ini files from /etc, but which one?

My knowledge about Ubuntu/Debian is really low but if i remember right /etc/php5/apache2/php.ini and /etc/php/7.0/apache2/php.ini are the "right" one, which one depends what PHP version you are going to use.

And if I could further impose on your knowledge and generosity, how do I tell the WP install to use php 7.0, not php5?

Virtualmin -> Virtual server -> Server configuration -> PHP versions - Here you should find all installed PHP versions, pick one you want and it should work.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sun, 06/17/2018 - 21:47
mxgroup

Hi, I am the other guy with the same problem. I placed the output of the php -m and apache2ctl -M commands here: https://pastebin.com/Lw4HdiDQ

I am running PHP in FPM mode. Could this be the problem? I have two php.ini files in my home directory, in the folders "myhome/etc/php.ini" and "myhome/etc/php7.2/php.ini"

Mon, 06/18/2018 - 10:36
Diabolico
Diabolico's picture

I suspect both of you could have some miss-configuration going on inside some of the php.ini files. If you are on Ubuntu and using FPM you should have php.ini inside /etc/php/"version number"/fpm/php.ini so maybe is worth to check that file.

To be honest i never encounter something similar with Centos and multiple PHP versions and as i previously said i'm not really "at home" with Ubuntu/Debian, so maybe if you guys try to dig more info it would help you even more. There was one guy on this forum with good knowledge about Ubuntu/Debian but looks like he isnt active anymore.

P.S. Its worth to check Apache/PHP files and their permissions (especially ones in /home) maybe some php.ini files dont have correct ownership.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Mon, 06/18/2018 - 15:39
mxgroup

Hi, thanks again for all the help! I got mine to work by changing the PHP module to mod_php. If I change it to FPM it does not work, and shows the reported error. But, everything else works when in FPM mode. I have a wordpress/woocommerce site with many plugins, and lots of other stuff all working fine with FPM. Just the install scrips does not work.

Tue, 06/19/2018 - 16:10
Diabolico
Diabolico's picture

Just the install scrips does not work.

When it comes to Wordpress and problem with installing it or the addons usually is the problem with file ownership but this isnt 100% so it could be something else. Who is the owner of php.ini files inside /home? It should be the virtual server admin, e.g. if you have /home/nicedomain/... then the owner of php.ini files should be nicedomain:nicedomain.

If I change it to FPM

Did you try to switch to fcgi?

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Wed, 06/20/2018 - 08:14
richb-hanover

Hi Diabolico - I really appreciate the effort you've put into solving this problem. I'm not sure that it's worth our time to struggle further because there's a clear workaround. I need to get a site up, and will use the standard Wordpress installer from the command line.

But I have created a new topic in the Virtualmin forum (https://www.virtualmin.com/node/57507) that documents the fact that the Install Scripts don't work "out of the box". Hopefully that will attract the attention of someone who can investigate.

Thanks again - you've done me a great service.

Rich Brown

Fri, 06/22/2018 - 18:31
Diabolico
Diabolico's picture

Well if there is no some obvious solution maybe its a bug and it would be good if you guys report that under "Issues".

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Wed, 11/27/2019 - 16:04
bencro
bencro's picture

We have found that the having FCGI being used instead of FPM can affect this. Server configurations > Website Options Make sure - Run CGI scripts as domain owner. Then make sure that the PHP execution mode is set at : FCGID.

You can then revert back to FPM if you wish to.

Bencro Transition Design A Symphony For The Eyes www.btdkenya.com

Topic locked