I'm having big problems with php and mysql. php segfaults on certain
mysql calls, with the following logs in apache error log:
[Tue May 4 14:12:09 2004] [notice] child pid 60386 exit signal
Segmentation fault (11)
and in the syslog:
May 4 13:53:49 op-fi1 /kernel: pid 60023 (httpd), uid 80: exited on
signal 11
The following code segfaults php every time (or apache when accessed
from the browser):
<?php
$link = mysql_connect("localhost", "root", "secret");
mysql_select_db("mydatabase");
$result = mysql_query(SELECT * FROM mytable);
echo "<pre>";var_dump(mysql_fetch_field($result));
mysql_free_result($result);
mysql_close($link);
gdb output gives this:
Program received signal SIGSEGV, Segmentation fault.
0x81a5d1c in add_property_string_ex ()
(gdb) backtrace
#0 0x81a5d1c in add_property_string_ex ()
#1 0x80ebd2a in zif_mysql_fetch_field ()
#2 0x81b5b42 in execute ()
#3 0x81a3abe in zend_execute_scripts ()
#4 0x817bb1d in php_execute_script ()
#5 0x81bd882 in main ()
#6 0x8073d66 in _start ()
Does anyone have any ideas?
Thanks,
Marko
ps. Here are some phpinfo() details:
System FreeBSD op-fi1 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Wed Jun
i386
Build Date May 4 2004 13:40:10
Configure Command './configure' '--enable-versioning'
'--enable-memory-limit' '--with-layout=GNU' '--with-zlib-dir=/usr'
'--disable-all' '--with-regex=php' '--disable-cli' '--enable-bcmath'
'--with-bz2=/usr' '--enable-ctype' '--with-dom=/usr/local'
'--with-dom-xslt=/usr/local' '--with-dom-exslt=/usr/local'
'--enable-ftp' '--with-gd' '--enable-gd-native-ttf'
'--enable-gd-jis-conv' '--with-freetype-dir=/usr/local'
'--with-t1lib=/usr/local' '--with-jpeg-dir=/usr/local'
'--with-png-dir=/usr/local' '--with-xpm-dir=/usr/X11R6'
'--with-gettext=/usr/local' '--with-iconv-dir=/usr/local'
'--with-iconv=/usr/local' '--enable-mbstring'
'--with-mcrypt=/usr/local' '--with-mhash=/usr/local'
'--with-mime-magic=/usr/share/misc/magic.mime'
'--with-mysql=/usr/local' '--enable-overload' '--with-pcre-regex=yes'
'--enable-posix' '--enable-session' '--enable-sockets'
'--enable-tokenizer' '--with-unixODBC=/usr/local' '--enable-wddx'
'--with-expat-dir=/usr/local' '--enable-xml' '--with-xmlrpc'
'--with-zip=/usr/local' '--with-zlib=yes'
'--with-apxs=/usr/local/sbin/apxs' '--with-imap=/usr/local'
'--with-imap-ssl=/usr/local' '--prefix=/usr/local'
'i386-portbld-freebsd4.8'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/etc/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/include/mysql
MYSQL_LIBS -L/usr/local/lib -lmysqlclient