NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP segmentation fault with custom-compiled binaries -Zen Cart

Hans Zaunere lists at zaunere.com
Mon Feb 14 11:20:30 EST 2005


> I did change the page moztips.com/php5_install from what I originally
> did, since it also serves as a guide for other people. Originally, I
> tried compiling PHP 5 by linking it against the system MySQL libraries -
> by using --with-mysql=/usr. But for some reason, that was not working.
> The configure script would produce an error when I tried that. I

What error?

What kind of a box is this?  64 bit by chance?

> downloaded PHP 4.3.10, and could build it using its built-in MySQL
> client libraries. But PHP 5 does not come with MySQL client libraries.
> 
> So I downloaded the MySQL source and compiled just the client libraries
> ( --without-server ) locally. Then I tried compiling PHP 5 against those
> libraries. This got past configure, make and make install. But when any
> PHP script encountered a mysql_fetch_row function (or something
> similar), the PHP binary segfaulted. I boiled it down to a testcase, and
> reproduced this.

If you have a test case, it might be a bug.  However, it might also be that you didn't compile against the libs you thought you did.

> So my last hope (I think), is to build PHP 5 against a MySQL shared
> object library ( libmysqlclient.so ). But when I tried doing this on
> Dreamhost (Debian Stable, shared hosting), it would not output the
> shared object files, even after 'make install'. I tried doing the same
> thing on my SuSe box (dedicated server, root access) and it worked fine.
> 
> So my question is: can I build a MySQL shared object library on one
> system, then copy that to Dreamhost, and then build PHP 5 against this
> shared object using something like:
> --with-mysql=shared,/home/myusername/shared_so
> ?

I would shy away from this.  Moving binaries and libs around is often asking for trouble.

Your hosting provider should have the proper MySQL libs installed for the database you're connecting to, and you should be able to compile PHP against them.  Also check out the version of MySQL they have; they might have an old one, etc.

H






More information about the talk mailing list