phpinfo() doesn't show updated mysql version

phpinfo() doesn't show updated mysql version

by Don Quixote -
Number of replies: 3
I was upgrading mysql to 4.0.20 twice on different servers (one running with Fedora Core1 and the other with RHEL3). In both cases phpinfo() appaerently doesn't show the new version number.

If I type "mysql --version" in the shell I get the right version number.

Also, on a moodle installation I get the old version number if I check "/admin/phpinfo.php" but the new one if I check it through phpmyadmin.

Any ideas?
Average of ratings: -
In reply to Don Quixote

Re: phpinfo() doesn't show updated mysql version

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It doesn't work that way!!

PHP has to be *compiled* with the appropriate mysql client libraries, so you will see the mysql support that PHP was built with. I don't think I've ever tried it, but I think I am right in saying that you don't actually need mysql on your machine at all for mysql support in PHP to function.

In any case there has never been anything like as much development in mysql clients as there has been in the servers and they seem to be roughly up and down compatible - in other words, unless you have a compelling reason to upgrade the client libraries, I wouldn't bother.
In reply to Howard Miller

Re: phpinfo() doesn't show updated mysql version

by Don Quixote -
Hi Howard,

I have upgraded with
MySQL-client-4.0.20-0.i386.rpm
MySQL-server-4.0.20-0.i386.rpm
and also installed
MySQL-shared-compat-4.0.20-0.i386.rpm
which should ensure that the 3.23.58 as well as 4.0.20 client API are supported. During upgrade I resolved all dependencies and everything worked fine.

In addition, I have recompiled PHP afterwards and believe wink everything worked fine (didn't get any errors). Maybe something went wrong there nevertheless, it's probably the point I will have to check.

It seems to me that PHP/ phpinfo() only doesn't recognize the new PHP client API, since it shows only the wrong version there. As mentioned, with phpMyAdmin it shows the correct MySQL server version.

You wrote
"that you don't actually need mysql on your machine at all for mysql support in PHP to function"
Frankly, I don't understand what you mean, sorry. I am quite sure that I need to have a mysql server on my machine...

Greetings
Andreas


In reply to Don Quixote

Re: phpinfo() doesn't show updated mysql version

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
PHP only includes the MySql client software, it has nothing to do with the MySql server. What I mean is that you don't need a mysql server on your machine to build php.

Did you specify the location of your mysql libraries when you configured php? If you do not it will use the bundled libraries. I have had problems building php from source when mysql has been installed using rpms. The rpms usually install the libraries in non-standard locations, and this can make the process 'difficult'.

I still don't see why you want to do this. A 3.23.58 client library will work just fine with a 4.0.20 server. This is not normally something you would have to worry about.