php5 upgrade missing mysql

6 posts / 0 new
Last post
#1 Sat, 04/04/2009 - 01:45
KassidyClark

php5 upgrade missing mysql

I recently upgraded to php5 from the Virtualmin repository and things have been going a bit crazy ever since. Finally, it appears I have both php4 (for legacy sites?) and php5 running. This is great, but websites requiring mysql (Wordpress) cannot run using php5 because the mysql module is missing. I installed the php5-mysql package via YUM and restarted the webserver, but nothing changed.

I've searched the forums which suggested changing the /etc/php5/apache2/php.ini but my server doesn't have this directory. According to a phpinfo() page I executed, mysql isn't listed in the loaded modules either. Does anyone know where this needs to be enabled?

I'm running CentOS 4.7, by the way.

Sat, 04/04/2009 - 06:16
andreychek

Howdy,

In theory, installing php5-mysql should be enough to get the module loaded.

There's a .ini file that loads mysql.so that should exist somewhere in /etc/. What you may want to do is look at your phpinfo() output, and make sure that it's looking in the dir that contains that .ini file.

If you like, feel free to post a URL containing your phpinfo() output, and I'd be happy to help you debug it.
-Eric

Sat, 04/04/2009 - 12:42
KassidyClark

Hey Eric,

Thanks for the quick reply. Here is the output: http://www.d-vers.nl/test/test.php

No mysql is being loaded and it appears that the configure command is specifically not including mysql support, even though this is the php5 from the virutalmin repository.

I also can't find anything in the domain/etc/php5/php.ini that mentions mysql.

Any advice is greatly appreciated!

Sat, 04/04/2009 - 12:45
KassidyClark

OK, upon closer inspection the file /etc/php5/php.d/mysql.ini contains the code: extension=mysql.so and this is evidently being parsed.

Sat, 04/04/2009 - 15:59 (Reply to #4)
andreychek

Hmm, does your extension_dir exists?

It looks like that's set to:

extension_dir: /usr/lib/php/modules

If not, where does the mysql.so module live? You can find that with:

find /usr -name mysql.so

Sun, 04/05/2009 - 00:16
KassidyClark

Wow, that was simple. The extension directory existed but was empty. The correct directory was /usr/lib/<b>php5</b>/modules. I changed this in the php.ini and presto, the mysql is loaded according to the phpinfo() and the site works like a charm.

I had expected it to me something more drastic and difficult, so now I'm a bit disappointed that I didn't notice such a simple mistake in configuration. Oh, well! =(

Hey, thanks a million for the help!

Topic locked