472,127 Members | 1,499 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

MySQL5 & PHP5

Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?

Thanks
Jul 17 '05 #1
12 3458
You need to look at the 'configure command' in phpinfo() and use it to
recompile php.
You have to install the mysql development header files and recompile Php
with the --with-mysql configure option.

At the moment your version of PHP is compiled with support for mysql3.23
Sarah Tanembaum wrote:
Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?

Thanks

Jul 17 '05 #2
Peter wrote:
You need to look at the 'configure command' in phpinfo() and use it to
recompile php.
You have to install the mysql development header files and recompile Php
with the --with-mysql configure option.

At the moment your version of PHP is compiled with support for mysql3.23
Sarah Tanembaum wrote:
Though I installed MySQL5 and PHP5, how come my phpinfo() shows as
follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?

Thanks


Is there a reason why they do not compile them with the latest release?
Even for beta release?

I got the binary from PHP central repository, is there any other
reliable place I can download binaries for mswin32?

PS: I'm running on windows.

Thanks
Jul 17 '05 #3
>>> Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?

Thanks


Is there a reason why they do not compile them with the latest release?
Even for beta release?


For the widely available binaries they compile against the lowest common
denominator: MySQL 3.x.
It is up to deployers to recompile it for a specific version. Also MySQL
5.x is not even close to stable, and MySQL 4.1 stable has only recently
appeared.
Tristan
Jul 17 '05 #4
On Thu, 02 Dec 2004 13:01:55 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:
Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?


You're apparently using the MySQL client library bundled with the Windows zip
distribution, rather than one from your MySQL installation.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #5
Andy Hassall wrote:
On Thu, 02 Dec 2004 13:01:55 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:

Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?

You're apparently using the MySQL client library bundled with the Windows zip
distribution, rather than one from your MySQL installation.

Hi Andy, isn't that the only Windows binaries distribution available
from MySQL? Or perhaps there are other Windows Binaries distribution
that I'm not aware of?

At any case, I presume that the later version will be much better
organize/design for OR(Object-Relational) or OO(Object Oriented)
programming, plus it will take advantage of additional features in 4.1
as well as 5.x. Thanks
Jul 17 '05 #6
On Thu, 02 Dec 2004 14:39:46 -0500
Sarah Tanembaum <sa************@yahoo.com> wrote:

:Hi Andy, isn't that the only Windows binaries distribution available
:from MySQL? Or perhaps there are other Windows Binaries distribution
:that I'm not aware of?
:
:At any case, I presume that the later version will be much better
:organize/design for OR(Object-Relational) or OO(Object Oriented)
:programming, plus it will take advantage of additional features in 4.1
:as well as 5.x. Thanks

As with all things Windows, it's a bit obscure. For PHP5, I get the
same listing as you do (3.23.57) with php_info(), but if I use mysql
from a "command prompt," then

mysql> \s

tells me "Server Version 4.1.7" so I dunno. This is the mysqld that
Apache interacts with through PHP.

--
Tony Reed
<tr***@altern.org>
Jul 17 '05 #7
On 02 Dec 2004 16:02:54 -0500, Tony Reed <tr***@altern.org> wrote:
On Thu, 02 Dec 2004 14:39:46 -0500
Sarah Tanembaum <sa************@yahoo.com> wrote:

:Hi Andy, isn't that the only Windows binaries distribution available
:from MySQL? Or perhaps there are other Windows Binaries distribution
:that I'm not aware of?
:
:At any case, I presume that the later version will be much better
:organize/design for OR(Object-Relational) or OO(Object Oriented)
:programming, plus it will take advantage of additional features in 4.1
:as well as 5.x. Thanks

As with all things Windows, it's a bit obscure. For PHP5, I get the
same listing as you do (3.23.57) with php_info(), but if I use mysql
from a "command prompt," then

mysql> \s

tells me "Server Version 4.1.7" so I dunno. This is the mysqld that
Apache interacts with through PHP.


That's because that's the server version, which has nothing to do with the
client version. Further, the fact that you're running 'mysql' means that's come
from a MySQL install; PHP only comes with a client DLL, not the mysql CLI
program.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #8
On Thu, 02 Dec 2004 14:39:46 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:
Andy Hassall wrote:
On Thu, 02 Dec 2004 13:01:55 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:

Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?
You're apparently using the MySQL client library bundled with the Windows zip
distribution, rather than one from your MySQL installation.


Hi Andy, isn't that the only Windows binaries distribution available
from MySQL?


You're using the MySQL library shipped with PHP, so it's not "from MySQL".

If you set your PATH appropriately and/or got rid of the libmySQL.dll in the
PHP directories, so instead it picks up libmysql.dll from your MySQL
directories, then you'd (probably) get a different version showing up.
Or perhaps there are other Windows Binaries distribution
that I'm not aware of?
There's a Windows binary distribution of PHP, which includes an old client
library.

There's a Windows binary distribution of MySQL, which includes a client
library of whichever version you downloaded.
At any case, I presume that the later version will be much better
organize/design for OR(Object-Relational) or OO(Object Oriented)
programming, plus it will take advantage of additional features in 4.1
as well as 5.x. Thanks


No, changing your MySQL client will have little or no effect on the PHP mysql
extension. However, PHP5 has the mysqli extension for use with 4.1 or later.

As to whether it takes advantage of any new features - check the docs. mysqli
supposedly supports prepared statements, at least.

Not sure why you'd want to use MySQL 5 at this stage though, since it's only
beta. Stick to 4.1 at the latest, unless you're being very experimental.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #9
Andy Hassall wrote:
On Thu, 02 Dec 2004 14:39:46 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:

Andy Hassall wrote:
On Thu, 02 Dec 2004 13:01:55 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:

Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57 <<<<<<<<<<<<<<<

Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do
something wrong?

You're apparently using the MySQL client library bundled with the Windows zip
distribution, rather than one from your MySQL installation.


Hi Andy, isn't that the only Windows binaries distribution available

from MySQL?


You're using the MySQL library shipped with PHP, so it's not "from MySQL".

If you set your PATH appropriately and/or got rid of the libmySQL.dll in the
PHP directories, so instead it picks up libmysql.dll from your MySQL
directories, then you'd (probably) get a different version showing up.

Or perhaps there are other Windows Binaries distribution
that I'm not aware of?

There's a Windows binary distribution of PHP, which includes an old client
library.

There's a Windows binary distribution of MySQL, which includes a client
library of whichever version you downloaded.

At any case, I presume that the later version will be much better
organize/design for OR(Object-Relational) or OO(Object Oriented)
programming, plus it will take advantage of additional features in 4.1
as well as 5.x. Thanks

No, changing your MySQL client will have little or no effect on the PHP mysql
extension. However, PHP5 has the mysqli extension for use with 4.1 or later.

As to whether it takes advantage of any new features - check the docs. mysqli
supposedly supports prepared statements, at least.

Not sure why you'd want to use MySQL 5 at this stage though, since it's only
beta. Stick to 4.1 at the latest, unless you're being very experimental.


Hi Andy, I did replace c:\php5\libmysql.dll with
c:\mysql5\lib\opt\libmysql.dll, restart the apache2, and check again.
Unfortunately, nothing change, it still say 3.23.57.

Perhaps I need newer c:\php5\ext\php_mysql.dll for mysql5. Where can I
get the binaries for php5/mysql5 dlls?

How do you use mysqli anyway? Is it not compatible with the mysql version?

Thanks
Jul 17 '05 #10
On Thu, 02 Dec 2004 23:03:18 +0000
Andy Hassall <an**@andyh.co.uk> wrote:

:
: If you set your PATH appropriately and/or got rid of the libmySQL.dll in the
:PHP directories, so instead it picks up libmysql.dll from your MySQL
:directories, then you'd (probably) get a different version showing up.
:

I tried that just now, it doesn't work, you get errors about missing
commands (I think that's what it said) from Apache when you try to
restart it. The libmysql.dll in the PHP distribution is needed. It
somehow "links" to the "main" libmysql.dll in the MySQL distribution
(which is much bigger). What I think is that mod_mysql.dll is what
Apache is using as a "reference," Note: all the words in quotes, I know
that they're not the right words.

I (obviously) haven't tried out all the features of MySQL against what
Apache's PHP module knows about it, but the minor stuff I _do_ use
works just fine.

Hmm. I'll boot up my OS X system and see what's what in there once the
trouble's finished with the Mac; that's got the same versions of
Apache/PHP/MySQL as my NT 4 system, except that I compiled them all.
Of course, they don't call them *.dll in Unix, I think that the *.so
files are the same thing.
--
Tony Reed
<tr***@altern.org>
Jul 17 '05 #11
On 02 Dec 2004 20:39:05 -0500, Tony Reed <tr***@altern.org> wrote:
On Thu, 02 Dec 2004 23:03:18 +0000
Andy Hassall <an**@andyh.co.uk> wrote:

:
: If you set your PATH appropriately and/or got rid of the libmySQL.dll in the
:PHP directories, so instead it picks up libmysql.dll from your MySQL
:directories, then you'd (probably) get a different version showing up.
:

I tried that just now, it doesn't work, you get errors about missing
commands (I think that's what it said) from Apache when you try to
restart it. The libmysql.dll in the PHP distribution is needed. It
somehow "links" to the "main" libmysql.dll in the MySQL distribution
(which is much bigger). What I think is that mod_mysql.dll is what
Apache is using as a "reference," Note: all the words in quotes, I know
that they're not the right words.

I (obviously) haven't tried out all the features of MySQL against what
Apache's PHP module knows about it, but the minor stuff I _do_ use
works just fine.


Lots of confusion here; doesn't help that the PHP documentation is wrong and
misleading. http://uk.php.net/mysql says:

"In Windows, there is no DLL, it's simply built into PHP 4." (No, it isn't,
it's linked to the bundled MySQL 3.2 client library DLL)

"In PHP 5, MySQL is no longer enabled by default, nor is the MySQL library
bundled with PHP." (It is on Windows, though)

PHP's MySQL extension module isn't specific to Apache, in fact Apache doesn't
really come into the picture at all here.

OK... PHP's php_mysql.dll is linked to libmysql.dll.

libmysql.dll bundled with PHP is a full 3.2 client library. It is not linked
to a full MySQL installation elsewhere. Download Dependency Walker and have a
look if you want.

Having now tried replacing the DLL on my local system, it indeed doesn't work,
as you point out, with 4.0 or 4.1, as ext/php_mysql.dll tries to import
functions from the libmysql.dll that the 4.0 and 4.1 client library apparently
doesn't export - the first one it picks up is mysql_drop_db.

According to the MySQL manual this is a deprecated function:

http://dev.mysql.com/doc/mysql/en/mysql_drop_db.html

It doesn't mention that not only is it deprecated, it in fact apparently no
longer exists. Presumably if you compiled from source (as is usual on Unix),
it's got different paths in the PHP php_mysql.dll code based on the MySQL
version.

Looking at the source code, this is exactly the case:

(ext/mysql/php_mysql.c:112)

#if MYSQL_VERSION_ID < 40000
PHP_FE(mysql_create_db, NULL)
PHP_FE(mysql_drop_db, NULL)
#endif

So if you want to use a client library of a later version than the 3.2 library
bundled with the Windows binary distribution, it appears you either have to
compile it yourself, or find someone else who has done so and nab their copy of
php_mysql.dll.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #12
On Thu, 02 Dec 2004 18:58:24 -0500, Sarah Tanembaum <sa************@yahoo.com>
wrote:
Hi Andy, I did replace c:\php5\libmysql.dll with
c:\mysql5\lib\opt\libmysql.dll, restart the apache2, and check again.
Unfortunately, nothing change, it still say 3.23.57.
See my other message in reply to Tony Reed - unless you recompile PHP, you
have to stick with the bundled 3.23.57 library.
Perhaps I need newer c:\php5\ext\php_mysql.dll for mysql5. Where can I
get the binaries for php5/mysql5 dlls?
Not so much newer, but just recompiled against a later MySQL version. Maybe
you could search Google.

Having said all this, there's still the question whether running with a
3.23.57 client actually makes any difference - you won't get any new features
with a new client library. Maybe there's bug fixes or performance issues. Don't
know.
How do you use mysqli anyway? Is it not compatible with the mysql version?


See http://php.net/mysqli. The mysql extension doesn't support any new
features past 3.2. If you want to use some of the new MySQL features, you use
mysqli.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Centurion | last post: by
1 post views Thread by Tony | last post: by
4 posts views Thread by cyrano | last post: by
5 posts views Thread by Aziz | last post: by
1 post views Thread by soft_devjava | last post: by
1 post views Thread by arunsuriindia | last post: by
4 posts views Thread by opswordfish | last post: by
1 post views Thread by Gilles Ganault | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.