I'm trying to get PHP4 (don't ask) to play with Apache 1.3 and MySQL 4.1 on debian sarge, but apache consistently seg faults at mysql_connect() or mysql_select_db(). If I comment out those lines the page runs, prints it's message, and then mysql_close() generates a warning that there was no such connection. PHP works otherwise.
<br><br>/etc/php/apache/php.ini does have 'extension=mysql.so'. Commenting it out causes an immediate complaint about not recognizing the mysql stuff, so that's not the problem.<br><br>I'm stumped, and was wondering if a PHP or Apache whiz could see an obvious problem in the setup below. I saw some examples of using gdb on google so I've included a backtrace to see if that's helpful.(Note: The FastCGI module is not enabled, and I have tried disabling mod_auth_mysql.)
<br><br>Thanks in advance,<br><br>Steve<br>----------<br><html><br><head><br>        <title>Test PHP</title><br></head><br><body><br><?php<br>// names changed to protect the innocent<br>$dbhost = 'localhost';
<br>$dbuser = 'someuser';<br>$dbpass = 'somepass';<br>//$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');<br><br>$dbname = 'somedb';<br>//mysql_select_db($dbname);<br>print 'Appear to be connected.';
<br>mysql_close($conn); <br>?><br></body><br></html><br><br>grep shortened this stuff - libmysqlclient is libmysqlclient12 & libmysqlclient14<br><br>mercury:/etc/apache# dpkg -l '*php*' | grep ii <br>ii libapache-mod-
4.3.10-16 server-side, HTML-embedded scripting languag<br>ii php4 4.3.10-16 server-side, HTML-embedded scripting languag<br>ii php4-cli 4.3.10-16 command-line interpreter for the php4 script
<br>ii php4-common 4.3.10-16 Common files for packages built from the php<br>ii php4-mysql 4.3.10-16 MySQL module for php4<br>ii php4-pear 4.3.10-16 PEAR - PHP Extension and Application Reposit
<br><br>mercury:/etc/apache# dpkg -l '*apache*' | grep ii <br>ii apache 1.3.33-6sarge1 versatile, high-performance HTTP server<br>ii apache-common 1.3.33-6sarge1 support files for all Apache webservers<br>ii apache-dev
1.3.33-6sarge1 development kit for the Apache webserver<br>ii apache-doc 1.3.33-6sarge1 documentation for the Apache webserver<br>ii apache-utils 1.3.33-6sarge1 utility programs for webservers (transitiona<br>ii apache2-utils
2.0.54-5 utility programs for webservers<br>ii libapache-mod- 4.3.9-2 Apache module for MySQL authentication<br>ii libapache-mod- 2.4.2-6 FastCGI module for Apache<br>ii libapache-mod- 4.3.10-16 server-side, HTML-embedded scripting languag
<br>ii libapache-mod- 2.8.22-1sarge1 Strong cryptography (HTTPS support) for Apac<br><br>mercury:/etc/apache# dpkg -l '*mysql*' | grep ii <br>ii courier-authmy 0.47-4sarge5 Courier Mail Server - MySQL authentication<br>
ii libapache-mod- 4.3.9-2 Apache module for MySQL authentication<br>ii libdbd-mysql-p 2.9006-1 A Perl5 database interface to the MySQL data<br>ii libmysqlclient 3.23.56-3 LGPL-licensed client library for MySQL datab
<br>ii libmysqlclient 4.0.24-10sarge mysql database client library<br>ii libmysqlclient 4.1.11a-4sarge mysql database client library<br>ii libmysqlclient 4.1.11a-4sarge mysql database development files<br>ii mysql-client-4
4.1.11a-4sarge mysql database client binaries<br>ii mysql-common-4 4.1.11a-4sarge mysql database common files (e.g. /etc/mysql<br>ii mysql-server-4 4.1.11a-4sarge mysql database server binaries<br>ii php4-mysql 4.3.10-16
MySQL module for php4<br>ii postfix-mysql 2.1.5-9 MYSQL map support for Postfix<br><br><br><br>mercury:/etc/php4/apache# gdb apache<br>GNU gdb 6.3-debian<br>Copyright 2004 Free Software Foundation, Inc.<br>
GDB is free software, covered by the GNU General Public License, and you are<br>welcome to change it and/or distribute copies of it under certain conditions.<br>Type "show copying" to see the conditions.<br>There is absolutely no warranty for GDB. Type "show warranty" for details.
<br>This GDB was configured as "i386-linux"...(no debugging symbols found)<br>Using host libthread_db library "/lib/tls/libthread_db.so.1".<br><br>(gdb) run -X<br>Starting program: /usr/sbin/apache -X<br>
(no debugging symbols found)<br>(no debugging symbols found)<br>(no debugging symbols found)<br>[Thread debugging using libthread_db enabled]<br>[New Thread 1076537184 (LWP 14460)]<br>(no debugging symbols found)<br>(no debugging symbols found)
<br>(no debugging symbols found)<br>(no debugging symbols found)<br>(no debugging symbols found)<br>(no debugging symbols found)<br>(no debugging symbols found)<br>(no debugging symbols found)<br><br>Program received signal SIGSEGV, Segmentation fault.
<br>[Switching to Thread 1076537184 (LWP 14460)]<br>0x401e7965 in mallopt () from /lib/tls/libc.so.6<br>(gdb) bt<br>#0 0x401e7965 in mallopt () from /lib/tls/libc.so.6<br>#1 0x401e6c43 in malloc () from /lib/tls/libc.so.6
<br>#2 0x403fc9be in my_malloc () from /usr/lib/libmysqlclient.so.14<br>#3 0x404216c9 in vio_new () from /usr/lib/libmysqlclient.so.14<br>#4 0x4041ef93 in mysql_real_connect () from /usr/lib/libmysqlclient.so.14<br>#5 0x403b5656 in zm_info_mysql () from /usr/lib/php4/20020429/mysql.so
<br>#6 0x403b680c in zif_mysql_connect () from /usr/lib/php4/20020429/mysql.so<br>#7 0x40753f60 in execute () from /usr/lib/apache/1.3/libphp4.so<br>#8 0x40743b71 in zend_execute_scripts () from /usr/lib/apache/1.3/libphp4.so
<br>#9 0x40715c7f in php_execute_script () from /usr/lib/apache/1.3/libphp4.so<br>#10 0x4075820e in apache_php_module_main () from /usr/lib/apache/1.3/libphp4.so<br>#11 0x40758ddc in apache_php_module_main () from /usr/lib/apache/1.3/libphp4.so
<br>#12 0x40758fa1 in apache_php_module_main () from /usr/lib/apache/1.3/libphp4.so<br>#13 0x080553c3 in ap_invoke_handler ()<br>#14 0x08068465 in ap_some_auth_required ()<br>#15 0x08068614 in ap_process_request ()<br>#16 0x08060bd2 in ap_child_terminate ()
<br>#17 0x08060e9a in ap_child_terminate ()<br>#18 0x08060f10 in ap_child_terminate ()<br>#19 0x08061a9a in ap_child_terminate ()<br>#20 0x08061ff8 in main ()<br>(gdb) <br><br><br>