[nycphp-talk] mysql and mysqli together (with PHP 5.0.3)
Hans Zaunere
hans at nyphp.com
Sun Dec 26 21:21:17 EST 2004
> > > I upgraded to MySQL 1.4.8. It's installed in /usr/local/mysql and
I
> > can
> > > connect with it just fine via the command line.
> >
> > MySQL 4.1.8, right? :)
>
> Numbers number numbers, to paraphrase Hamlet. (-:
>
> > <snip />
> > Depending exactly on the weirdness you're seeing, it could be
related to
> > the new authentication protocol and passwords MySQL 4.1.x uses by
> > default.
> >
>
> I was seeing stuff so weird and mysterious that I didn't know where to
> begin, hence the vagueness. I would try to use "classic" mysql and a
let's
> say page1.php would fail; so I'd try page2.php in a browser and kept
> getting page1.php back at me. I would look at Apache error log and see
> segmentation fault. I would get things quietly failing and not be able
to
> find a verbose error message anywhere.
>
> I got tired and cowardly tried a different tack: compile php 4.3.10
with
> just mysql support; compile php 5.0.3 with just mysqli support. Played
> with some PEAR DB test scripts that checked the version at runtime and
> loaded either mysql or mysqli depending. Worked fine in both 4 and 5.
But
> I could only get phpMyAdmin to work with mysqli. (PS I also hacked
> PhpMyAdmin config to check the PHP version and load the appropriate
> extension.)
There might be problems with dynamically loading an extension, since I'm
not sure how stable/recommended that actually is. Perhaps a recompile
with the extensions as static would help?
> Now I am finding a most peculiar behavior with my 4.3.10 which is
breaking
> phpMyAdmin et al and has nothing to do with MySQL. On a different
> (FreeBSD) host the behavior is what you expect, but on my (RH9)
machine, I
> when I run this...
>
> <?php
> $array = array('one' ,'two','three' );
> foreach ($array as $i) {
> echo "$i<br />\n" ;
> }
> ?>
> ... I get:
>
> Array
> Array
> Array
>
> .. instead of:
>
> one
> two
> three
>
> How strange is that?
That is some strangeness - seems like the code is totally messed up.
Perhaps it's related to dynamically loading shared objects, but other
than that, I've never seen these problems (and have mysql/mysqli on many
different hardware, OS, and PHP versions).
H
More information about the talk
mailing list