NYCPHP Meetup

NYPHP.org

[nycphp-talk] php install: "can't find mysql headers"

Allen Shaw ashaw at iifwp.org
Sun Jul 10 22:28:33 EDT 2005


Oh, boy, what a bunch of quality advice. Hans (and a couple of others I
guess) hit it on the head:
> It's probably a cross
> compile/RPM issue/version mismatch.

I had mismatching versions of the mysql rpms -- something like devel-4.0.25,
server-4.0.22, client-4.0.22.  Like Hans suggested, I wiped 'em all out,
installed new packages (all 4.0.25) from MySQL AB, and recompiled PHP.
Configure ('--with-mysql=/usr') ran without a hitch, as did the rest of the
install.  Ace the installation problem.  Restart apache, and the segfaults
go away, too, at least all the ones I've noticed so far.  Ace the segfault
problem.

This is great to know.  From what I saw on the web, these problems
(apparently random segfaults from php/mysql; and "cannot find headers" in
php compile) have hit a number of people, and none of them were lucky enough
to find solutions this quickly; nobody suggested this cause to them, at
least not in the online discussions.  Hopefully the next guy will either
google up this list archive or have the good fortune of knowing a few folks
who know their stuff.

Thanks much,
Allen
----- Original Message ----- 
From: "Hans Zaunere" <lists at zaunere.com>
To: "'NYPHP Talk'" <talk at lists.nyphp.org>
Sent: Sunday, July 10, 2005 2:55 PM
Subject: RE: [nycphp-talk] php install: "can't find mysql headers"


>
> > Okay, I decided to go with a source install, and now I'm just confused.
> > As I mentioned earlier I installed php 4.3.11 from source this morning
> > without removing the existing php rpms, and I noticed that some things
> > weren't working.  So I went back and removed those rpms and tried to
> > rebuild again, but the problems don't go away.
> >
> > The real problem I'm trying to solve is that apache (1.3) is
> > consistently segfaulting on a few apparently randomly chosen calls.
> > That is, I have a few links on my site that are garuanteed to cause a
> > segmentation fault in apache, but it's seems oddly random why those
> > links are broken and not any other.  So I thought, maybe it's an arcane
> > php bug; upgrade to latest and then submit a bug-report if necessary.
> > Even stranger, now that I've upgraded, I get the *same* behavior, but on
> > *different* links (including any select operations with phpMyAdmin, but
> > not update, insert, etc., and not selects in other php scripts...)
> >
> > But my hope has been that, maybe, just maybe, there IS a bug in php's
>
> Hmm, unlikely - at least for something this simple.  It's probably a cross
> compile/RPM issue/version mismatch.
>
> > mysql support somewhere, and if I were to compile
> > --with-mysql=/path/to/mysql-headers I might just be okay.  But that
> > seems a no-go, too.
> >
> > Using '--with-mysql=/usr/include/mysql' gets me the error 'Cannot find
> > MySQL header files under /usr/include/mysql'; same for
> > '--with-mysql=/usr/lib/mysql'.  Those are the only two directories that
> > rpm says contain files from the MySQL-devel package.  And
> > /usr/include/mysql does contain mysql.h .
>
> So you have the RPMs of MySQL installed?  And you've also installed the
> libs/headers/shared libs/ RPMs from mysql.com, right?  Just to be overly
> certain, you also have all the same version number and playform, right?
>
> Before installing them, remove all MySQL or PHP RPMs.
>
> rpm -qa | grep -i mysql
> rpm -qa | grep -i php
>
> Then of course rpm -e each one.
>
> Once you seem to have things settled on that end, install the MySQL rpms.
> And probably wouldn't hurt to run ldconfig and check ldconfig -p to make
> sure the libs are installed and ready to be found (ie, they are listed).
>
> Now you can compile PHP, specifying the base path of the MySQL install,:
>
> --with-mysql=/usr
>
> Give that a try and see if it helps.
>
>
> ---
> Hans Zaunere
> President, Founder
>
> New York PHP
> http://www.nyphp.org
>
> AMP Technology
> Supporting Apache, MySQL and PHP
>
>
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org




More information about the talk mailing list