php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19730 PHP --with-mysql reports the wrong client API version
Submitted: 2002-10-02 20:09 UTC Modified: 2002-11-14 01:45 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: shane at sell dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 4.2.3 OS: debian linux potato
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shane at sell dot com
New email:
PHP Version: OS:

 

 [2002-10-02 20:09 UTC] shane at sell dot com
I have MySQL 4.0.4-beta installed. I configured php as follows:

 './configure' '--with-apache=/usr/local/src/apache_1.3.26' '--disable-magic-quotes' '--disable-short-tags' '--disable-debug' '--without-gd' '--enable-url-fopen-wrapper' '--enable-track-vars' '--enable-memory-limit' '--enable-inline-optimization' '--with-config-file-path=/usr/local/php/ini' '--with-mysql=/usr/local' '--enable-ftp' '--enable-sockets' '--enable-xml' '--enable-wddx' '--enable-bcmath' '--with-zlib=/usr' '--with-snmp' '--enable-ucd-snmp-hack' '--with-openssl' '--with-xmlrpc'

the php binary reports:

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.0.4-beta

apache (mod_php installed) reports:

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.35

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-02 20:59 UTC] sniper@php.net
Please do a clean build of Apache next time.
You should do 'make clean' in the apache sources at least,
better yet, get fresh sources and do the build from scratch.

 [2002-10-03 00:10 UTC] shane at sell dot com
I am using the latest sources for apache 1.3.26, mod_ssl 2.8.10, and php-4.2.3. Additionally, I am doing a build from source of MySQL 4.0.4.

*Every* time I build a new binary, I rm -rf each of the source directories, tar -zxvf each tarball, and rebuild from scratch. Below are the directives I am using to build apache, in order:

cd mod_ssl-2.8.10-1.3.26
./configure --with-apache=../apache_1.3.26

cd ../apache_1.3.26
./configure --prefix=/usr/local/apache

cd ../php-4.2.3
./configure --with-apache=/usr/local/src/apache_1.3.26 \
            --disable-magic-quotes \
            --disable-short-tags \
            --disable-debug \
            --without-gd \
            --enable-url-fopen-wrapper \
            --enable-track-vars \
            --enable-memory-limit \
            --enable-inline-optimization \
            --with-config-file-path=/usr/local/php/ini \
            --with-mysql \
            --enable-ftp \
            --enable-sockets \
            --enable-xml \
            --enable-wddx \
            --enable-bcmath \
            --with-zlib=/usr \
            --with-snmp \
            --enable-ucd-snmp-hack \
            --with-openssl \
            --with-xmlrpc

make -j15
make install

cd ../apache_1.3.26

./configure --prefix=/usr/local/apache \
            --enable-module=ssl \
            --activate-module=src/modules/php4/libphp4.a \
            --enable-module=rewrite \
            --enable-module=proxy \
            --enable-module=so

make
make install
 [2002-10-03 07:17 UTC] sniper@php.net
If you use '--with-mysql' with php configure, it will use the bundled mysql client libs which are of version 3.23.39
in 4.2.3. 

You must use the prefix with which you installed the mysql
to get the correct libs and headers.

Also, make sure you don't have some older mysql libs in your system's default libpath..

 [2002-10-03 09:26 UTC] shane at sell dot com
Apologies, I copy and pasted the wrong build script. As you can see from my first post to this bug, I did use a prefix of "/usr/local" when configuring php.

Since the shipped version of the mysql libs are 3.23.39 (not 3.23.35), it is obvious that the binary is built against other libs. Additionally, the box has never had a version of MySQL installed on it lower than 3.23.37, so the 3.23.35 version string has to be in error.

Additionally, there are no other copies of the mysql libs and includes other than the 4.0.4 set. I verified this over lunch one day when I left one of our boxen doing a recursive grep of /usr looking for old versions.

Have you attempted to reproduce this? It should be exceedingly easy for anyone to prove.
 [2002-10-03 19:27 UTC] sniper@php.net
I hope you're aware that the 'beta' text in that version for mysql really means that it's not ready for production..

Anyway, the api version shown in phpinfo() output comes from
mysql function called 'mysql_get_client_info()' and that is provided by the mysql client libs and in the bundled mysql lib sources it's like this:

mysql_get_client_info(void)
{
  return (char*) MYSQL_SERVER_VERSION;
}

Try grepping your whole system for that incorrect version and you'll find where it's defined..

 [2002-10-03 20:01 UTC] shane at sell dot com
with regards to the beta string, I have known about the development life cycle, and the alpha, beta, gamma, and release phases of development for many years. MySQL 4 is doing wonderfully in production, and we put each release through rigorous testing in house before implementing it. You should try it out sometime.

With regards to the version string, there are no files on the filesystem that match 3.23.35.

Have you tried to build it yet using the build method I sent? If so, what were the results?
 [2002-10-04 13:08 UTC] shane at sell dot com
Additionally, as I stated earlier, the PHP binary and the PHP Apache modules are being compiled on the same server, with the same configure options (except --with-apache).

Nothing on the server was changed between building the binary and the module. They both used clean source trees (freshly untarred, even). The binary reports the correct version, the module does not. The module also does not report the version of the included MySQL libs, instead it reports a version of MySQL that has never been installed on the server.
 [2002-10-04 18:29 UTC] sniper@php.net
Can you check what the build-date is in the phpinfo output where the incorrect mysql version is shown?
(2nd line, iirc)

Does it match the date you build it?

 [2002-10-04 19:21 UTC] shane at sell dot com
yes, it does. Both the binary build and the apache module were built on October 2, 2002, and they both show the correct build date.
 [2002-10-12 10:23 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


Even as I'm pretty sure this is some problem in your system or an user error..

 [2002-10-27 19:12 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2002-10-28 15:42 UTC] shane at sell dot com
Apologies for the delay; the previous message got lost in my inbox and I forgot to check up on it.

I am unable to build from the snapshot. I grabbed the latest snapshot, and ran buildconf in the root of the source tree. then I ran my configure line (pasted earlier). Error follows:

[root@aqua php4-200210280900]# make
gcc  -Iext/sockets/ -I/usr/local/src/php4-200210280900/ext/sockets/ -DPHP_ATOM_INC -I/usr/local/src/php4-200210280900/include -I/usr/local/src/php4-200210280900/main -I/usr/local/src/php4-200210280900 -I/usr/local/src/php4-200210280900/Zend -I/usr/local/ssl/include -I/usr/local/include/mysql -I/usr/local/include/ucd-snmp -I/usr/local/src/php4-200210280900/ext/xml/expat -I/usr/local/include  -I/usr/local/src/php4-200210280900/TSRM  -g -O2  -c /usr/local/src/php4-200210280900/ext/sockets/sockets.c -o ext/sockets/sockets.o  && echo > ext/sockets/sockets.lo
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning:   as it has already been specified as a non-system directory
/usr/local/src/php4-200210280900/ext/sockets/sockets.c:276: conflicting types for `php_read'
/usr/local/src/php4-200210280900/ext/sockets/php_sockets.h:105: previous declaration of `php_read'
make: *** [ext/sockets/sockets.lo] Error 1
[root@aqua php4-200210280900]#
 [2002-10-28 17:40 UTC] sniper@php.net
That compile error is fixed. Please try more recent snapshot tomorrow.

 [2002-11-14 01:45 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2007-09-17 06:14 UTC] maneeshabraham at gmail dot com
I have just Installed Apache2.0.59,Php 4.4.7 and MySQL 4.1.22 on windows 2003 server. When I run the phpinfo.php script, I see that the MySQL Client API version is 3.23.49 ,Shouldn't the MySQL Client API version be 4.1.12 to match the MySQL version? If so, what file(s) should I replace?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC