php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41410 php -i shows a different mysql api than phpinfo()
Submitted: 2007-05-16 17:35 UTC Modified: 2007-05-17 14:12 UTC
From: jesse at eonstreet dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.2 OS: Linux FC3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jesse at eonstreet dot com
New email:
PHP Version: OS:

 

 [2007-05-16 17:35 UTC] jesse at eonstreet dot com
Description:
------------
Hello,

I hope that is easy to fix, I'm not sure if it is bogus or not but after 2 days of searching and trying all different options I could use professional help.

I have upgraded to MySql 5.0.41 and upgraded to php 5.2.2 with out any difficulties.

The problem is that ' shell> php -i ' shows that the Mysql Client Api is 5.0.41 but with <? phpinfo(); ?> it shows Mysql Client Api 3.23.58

This did not happen with php 5.1.2.

It seems that that the apache handler is the only difference between the two outputs is:

Server API  Apache 2.0 Handler  [phpinfo()]
Server API => Command Line Interface

I have a feeling that this is related to Apache somehow.

I have tried many differeny types of compiles but I alway get the same result.  Below is a copy of the configure command.

The version of Apache is 2.0.53.

The server is definately 5.0.41 as I use phpMyAdmin for db stuff.  The problem is having an effect on phpMyAdmin as I can't browse any tables with this application. There is some major error as nothing appears in the apache error log nor the php error log.

After two days of unrelenting recompiles and endless searches I could really use some expert help.

Thank you.

Reproduce code:
---------------
./configure --build=i386-redhat-linux --host=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd-dir=/usr/lib --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses-dir=/usr/lib --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-libxml=/usr/include/libxml2 --with-expat-dir=/usr --with-dom-dir=/usr/lib,/usr --with-xsl --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex-dir=/usr/lib,usr/include --with-zlib-dir=/usr/lib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap-dir=/usr/lib --with-imap-ssl --with-kerberos --with-ldap-dir=/usr/lib --with-mysql=/usr  -with-mysql-sock=/var/lib/mysql/mysql.sock --with-pgsql-dir=/usr/lib --with-snmp-dir=/usr/lib,/usr --enable-ucd-snmp-hack --with-unixODBC-dir=/usr/lib,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mbstring --with-mcrypt-dir=/usr/lib,/usr/include --enable-mbstr-enc-trans --enable-mbregex --with-mime-magic=/usr/share/file/magic.mime --enable-soap --with-pic --with-apxs2=/usr/sbin/apxs 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-16 17:40 UTC] jesse at eonstreet dot com
PS: Php is loaded in apache with 
LoadModule php5_module        /usr/lib/httpd/modules/libphp5.so
 [2007-05-16 18:31 UTC] tony2001@php.net
CLI and apache SAPI were built with different MySQL headers.
 [2007-05-17 11:12 UTC] jesse at eonstreet dot com
Hello,

That is what I thought too but my box has never had mysql 3 installed. (It came with Mysql 4)

I have installed the Mysql rpms for devel, shared, shared-compat, client and server.

I would like to point out that the CLI and the sapi are being compiled at the same time with the same headers.

How is it possible that the compiler uses one set of headers for the cli api and another for the sapi?

This is why I think there is a bug in this version of php.  Php 5.1.4 used the correct header.

The process of my upgraded was as follows:

1) Upgrade to php 5.2.2 with the same configure command as was used with php 5.1.4 ( due to session variable problems in 5.1.4)

2) Tried to use phpMyAdmin but it failed to be able to browse any table with a result set (error of some sort that is not reported in any log file)

3) MySql Client Api with phpinfo() shows version 3.xx

4) Upgraded from Mysql 5.0.21 to 5.0.41 hoping that this would solve the problem

5) Recompiled many many times trying to get php to find the correct Mysql headers 

6) CLI api is compiled correctly SAPI is compiled incorrectly

I am not a master C programmer but I have a feeling that the Include command is not correct when sapi is compiled.  I believe that it is using libmysqlclient.so.10.0.0 instead of libmysqlclient.so.15.0.0 or even libmysqlclient.so which links to the lastest version.

I would remove libmysqlclient.so.10.0.0 or link it to just .so but I am afraid of breaking the system.

Please advise on how to fix this.

Thank you for taking the time to look at this ;)
 [2007-05-17 11:32 UTC] jesse at eonstreet dot com
Maybe this will help:

rpm -qa | grep -i mysql
MySQL-server-5.0.41-0
MySQL-shared-5.0.41-0
perl-DBD-MySQL-2.9003-5
MySQL-client-5.0.41-0
MySQL-devel-5.0.41-0
MySQL-shared-compat-5.0.41-0
php-mysql-4.3.11-2.8
mod_auth_mysql-20030510-5
 [2007-05-17 11:40 UTC] tony2001@php.net
> php-mysql-4.3.11-2.8

You have two different PHP versions installed: PHP4 (cli) and PHP5 (apache).

 [2007-05-17 12:22 UTC] jesse at eonstreet dot com
Possibly. But that was what came installed.

rpm -e php-mysql
error: Failed dependencies:
        php-mysql is needed by (installed) psa-7.5.4-fc3.build75050824.12.i586
        php-mysql is needed by (installed) psa-horde-3.1.1-fc3.build75060413.11.noarch
        php-mysql is needed by (installed) Sitebuilder-2.1.2-fc3.build051222.05.i386

Since I have upgraded and compiled the PHP src and installed the rpms for MySql what you are saying perplexes me.

Why wouold php -i return "PHP Version => 5.2.2" as does phpinfo() on Apache?

You can see from make install that both the CLI and SAPI are being recompiled and installed.

make install returns this:
Installing PHP SAPI module:       apache2handler
/usr/lib/httpd/build/instdso.sh SH_LIBTOOL='/bin/sh /usr/lib/apr/build/libtool' libphp5.la /usr/lib/httpd/modules
/bin/sh /usr/lib/apr/build/libtool --mode=install cp libphp5.la /usr/lib/httpd/modules/
cp .libs/libphp5.so /usr/lib/httpd/modules/libphp5.so
cp .libs/libphp5.lai /usr/lib/httpd/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /usr/src/php/php-5.2.2/libs'
chmod 755 /usr/lib/httpd/modules/libphp5.so
[activating module `php5' in /etc/httpd/conf/httpd.conf]
Installing PHP CLI binary:        /usr/bin/
Installing PHP CLI man page:      /usr/share/man/man1/
Installing shared extensions:     /usr/lib/20060613/
Installing build environment:     /usr/lib/build/
Installing header files:          /usr/include/php/
 [2007-05-17 14:12 UTC] jesse at eonstreet dot com
I have done the following:

1) rpm -e --nodeps  php-mysql

2) rpm -qa | grep -i mysql
MySQL-server-5.0.41-0
MySQL-shared-5.0.41-0
perl-DBD-MySQL-2.9003-5
MySQL-client-5.0.41-0
MySQL-shared-compat-5.0.41-0
MySQL-devel-5.0.41-0
mod_auth_mysql-20030510-5

3) rpm -Uvf --replacepkgs MySQL-devel-5.0.41-0.i386.rpm

I have removed the installation src file for php and untarred them again

I configure, make, make install

Still phpinfo() shows the wrong api...

Still think that this is bogus?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 02:01:32 2024 UTC