Re: [PHP-DEV] MySQL client library upgrade: 3.3.31

2001-01-17 Thread chrisv

On Wed, 17 Jan 2001, Thimble Smith wrote:

 On Wed, Jan 17, 2001 at 01:57:08AM -0800, [EMAIL PROTECTED] wrote:
  +AC_DEFUN(PHP_MYSQL_VERSION,[
  +  if test "$PHP_MYSQL" != "yes"; then
  +AC_MSG_CHECKING(for MySQL version)
  +MYSQL_VERSION=$( strings $MYSQL_LIB_DIR/libmysqlclient.so | grep '3\.' )
  +if test "x$( echo $MYSQL_VERSION | cut -f2 -d. )" = "x23" ; then
  +  AC_MSG_RESULT($MYSQL_VERSION)
  +  PHP_EVAL_LIBLINE($PHP_MYSQL/bin/mysql_config --libs)
  +else
  +  AC_MSG_RESULT($MYSQL_VERSION)
  +fi
  +  fi
  +])
 
 I think it would be better to simply check if mysql_config
 exists.  If so, use it; if not, assume that the version is older
 and doesn't need -lz.  One trouble with the above is that it
 won't work when 4.0 comes out (alpha should be pretty soon).
 Of course an extra test could be added, but I don't think it's
 needed.
 
 Did you mean to 'test "$PHP_MYSQL" = "yes"' up there, instead
 of '!='?  You could remove the else clause, and just put the
 AC_MSG_RESULT() outside the if.  Plus, there are some bashisms
 there that aren't portable.
I wouldn't doubt that there are some ways to make it better.. that was a
quick throw-together that took me about 5 minutes to make.

The reason it's "$PHP_MYSQL" != "yes" is because it's called from after
it's been determined that the user wants MySQL support, and a value of
"yes" is the value that is passed if the user wants to use the built-in
library (or so I could tell by reading the code..). I suppose most of that
could be rewritten to, perhaps something like the following:

AC_DEFUN(PHP_MYSQL_VERSION,[
if test "$PHP_MYSQL" != "yes"; then
AC_MSG_CHECKING(for MySQL version)
if test -x "$PHP_MYSQL/bin/mysql_config"; then
AC_MSG_RESULT(3.23 or better)
PHP_EVAL_LIBLINE($PHP_MYSQL/bin/mysql_config --libs)
else
AC_MSG_RESULT(3.22 or earlier)
fi
fi
])

(yet another 5 minute job.. I don't see any bash-isms in there, but there
could be some..)

Of course, this should only be called once it's been determined that the
user wants MySQL support and they don't want the built-in library..

Chris

PS: This is just an example.. as I mentioned, I'm sure there are better
ways to write it.


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] MySQL client library upgrade: 3.3.31

2001-01-16 Thread Ignacio Vazquez-Abrams

On Tue, 16 Jan 2001, Thimble Smith wrote:

 Hi, all.  I would like to upgrade ext/mysql/libmysql to the latest
 version.  There is one important bug fix.  Right now, the client
 can't connect to a server if mysqld is using a character set other
 than latin1.  There are also numerous bug fixes and a few added
 features.

 One thing I'm not sure about: in your version of config-win.h,
 the #definition of HAVE_COMPRESS is commented out.  Is this
 important, or is it okay to leave the way we have it in MySQL?

 The diff isn't too huge, so I'll put it at the end of this message.
 If no one has any objections, I'll commit it shortly.

 Ahh...it is pretty large (102K).  I've put it here:

 http://toxic.magnesium.net/~thim/mysql/php-mysql.diff

 Tim


I realize that this may be slightly off-topic, but I (and plenty others who
are aware of the problem) feel that it needs to be addressed.

When PHP is configured to use an external library for MySQL support, if zlib
support is not added then PHP fails with an "unresolved symbol: compress"
error due to the fact that the newer versions of the MySQL client libraries
seem to require libz.so in order to function. I have tried a couple of times
to patch ext/mysql/config.m4 to resolve this, but I haven't been successful.

Some PHP bug reports which refer to this problem are: 5651, 6811, 6981, 7266,
8307, 8332, and 8575.

I'm certain that there are many who would appreciate it if you could deal with
this issue once and for all.

Thank you for your time.

-- 
Ignacio Vazquez-Abrams  [EMAIL PROTECTED]





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] MySQL client library upgrade: 3.3.31

2001-01-16 Thread Ignacio Vazquez-Abrams

On Tue, 16 Jan 2001, Sean R. Bright wrote:

 Ignacio:

 This is my configure line:

 ./configure  --with-mysql=/usr/local/mysql --with-apxs=/usr/local/etc/httpd/
 bin/apxs

 And I have a relatively new (a month?) mysql tarball and haven't received
 this message.

 How are you configuring?

 Sean


Do any of the other modules you're loading in Apache require zlib? You can
find out by running ldd on them and looking for libz.so.

-- 
Ignacio Vazquez-Abrams  [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] MySQL client library upgrade: 3.3.31

2001-01-16 Thread Sean R. Bright

Oops.  I lied.  I don't use the --with-apxs flag.

./configure --with-mysql=/usr/local/mysql

Is my configure statement.  Creates the CGI version that when run from the
command line connects to the db, querys the datasource and displays the
results.

Sean

 -Original Message-
 From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 16, 2001 6:02 PM
 To: Sean R. Bright
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP-DEV] MySQL client library upgrade: 3.3.31


 On Tue, 16 Jan 2001, Sean R. Bright wrote:

  Ignacio:
 
  This is my configure line:
 
  ./configure  --with-mysql=/usr/local/mysql
 --with-apxs=/usr/local/etc/httpd/
  bin/apxs
 
  And I have a relatively new (a month?) mysql tarball and
 haven't received
  this message.
 
  How are you configuring?
 
  Sean
 

 Do any of the other modules you're loading in Apache require
 zlib? You can
 find out by running ldd on them and looking for libz.so.

 --
 Ignacio Vazquez-Abrams  [EMAIL PROTECTED]


 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]