Bug #18515 Updated: Apache2filter hangs on DNS request
| From: | sniper@php.net | Date: | Wed, 24 Jul 2002 00:56:37 +0000 |
| Subject: | Bug #18515 Updated: Apache2filter hangs on DNS request | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14967@lists.php.net to get a copy of this message | ||
ID: 18515
Updated by: sniper@php.net
Reported By: ryan@estara.com
-Status: Open
+Status: Feedback
Bug Type: Apache2 related
Operating System: Redhat 7.2
PHP Version: 4.2.2
New Comment:
You should also try the latest CVS versions of both Apache2 and PHP..
Previous Comments:
------------------------------------------------------------------------
[2002-07-23 20:56:00] sniper@php.net
reclassified
------------------------------------------------------------------------
[2002-07-23 18:33:12] ryan@estara.com
Also this will prevent resolution of hostnames in mod_rewrite say you
have have that configuration in your apache config and add a rewrite
rule of:
RewriteEngine on
RewriteRule ^/magik(.*) http://www.magik.net$1 [P]
it will hang on the lookup of 'www.magik.net'. It does not hang,
however, if you comment out the line where you load the php module.
------------------------------------------------------------------------
[2002-07-23 18:33:11] ryan@estara.com
Also this will prevent resolution of hostnames in mod_rewrite say you
have have that configuration in your apache config and add a rewrite
rule of:
RewriteEngine on
RewriteRule ^/magik(.*) http://www.magik.net$1 [P]
it will hang on the lookup of 'www.magik.net'. It does not hang,
however, if you comment out the line where you load the php module.
------------------------------------------------------------------------
[2002-07-23 17:38:52] ryan@estara.com
I submitted this bug in a previous version, it still exists and is
driving me crazy. Last time it was dismissed and I never followed up
because I found a work around. Here is the issue:
PHP 4.2.2 configured with:
./configure --prefix=/prod/apache/php
--with-apxs2=/prod/apache/bin/apxs --with-mysql --with-gd
Apache 2.0.39 configured with:
./configure --prefix=/prod/apache --enable-layout=Apache
--enable-ssl=shared --enable-vhost-alias=shared --enable-proxy=shared
--enable-rewrite=shared --with-mpm=worker --enable-info=shared
--disable-userdir --enable-so=max --enable-mods-shared
Try to get this php script that connects to a mysql database:
<?php
session_start();
echo "session id is ".session_id()."<br>\n";
echo "Testing: $testing<br>\n";
$link = mysql_connect("my.database.com", "username", "password")
or die("Could not connect");
print ("Connected successfully");
$db_name = "dbname";
$table_name = "tablename";
$select_db = mysql_select_db($db_name, $link);
$query = "SELECT Name FROM $table_name";
$result = mysql_query($query, $link) or die("Could not complete
database query");
$num = mysql_num_rows($result);
while ($row = mysql_fetch_row ($result))
{
print "Value stored at the first index position is
$row[0]<br>";
}
mysql_close($link);
?>
Make sure nscd is not running and the "my.database.com" is not in the
/etc/hosts file. The server will hang... the odd thing is that if you
don't include libgd support it will work. Something is screwy and I
haven't been able to track it down. Here is where it hangs though:
#0 0x402cc996 in __sigsuspend (set=0xbf5fd85c) at
../sysdeps/unix/sysv/linux/sigsuspend.c:45
#1 0x40290d6d in __pthread_wait_for_restart_signal (self=0xbf5ffc00)
at pthread.c:969
#2 0x40292863 in __pthread_lock (lock=0x400157fc, self=0xbf5ffc00) at
restart.h:34
#3 0x4028efdd in __pthread_mutex_lock (mutex=0x400157ec) at
mutex.c:109
#4 0x403b1728 in _dl_open (file=0xbf5fdb1c "libnss_dns.so.2", mode=1,
caller=0x0) at dl-open.c:401
#5 0x403b267e in do_dlopen (ptr=0xbf5fdaec) at dl-libc.c:78
#6 0x4000ce55 in _dl_catch_error (objname=0xbf5fdae4,
errstring=0xbf5fdae8, operate=0x403b265c <do_dlopen>, args=0xbf5fdaec)
at dl-error.c:152
#7 0x403b252e in __libc_dlopen (__name=0xbf5fdb1c "libnss_dns.so.2")
at dl-libc.c:42
#8 0x403937c7 in __nss_lookup_function (ni=0x80fa400,
fct_name=0x403c6e6e "gethostbyname_r") at nsswitch.c:340
#9 0x40394304 in __nss_next (ni=0xbf5fdc4c, fct_name=0x403c6e6e
"gethostbyname_r", fctp=0xbf5fdc50, status=-1, all_values=0)
at nsswitch.c:194
#10 0x40396ce9 in __gethostbyname_r (name=0x81b9564
"reports.estara.com", resbuf=0x403d1620, buffer=0x81b7168 "\177",
buflen=1024,
result=0xbf5fdc90, h_errnop=0xbf5fdc94) at
../nss/getXXbyYY_r.c:215
#11 0x403966da in gethostbyname (name=0x81b9564 "my.database.com") at
../nss/getXXbyYY.c:131
#12 0x40529eb7 in mysql_real_connect () from
/prod/mysql/lib/mysql/libmysqlclient.so.10
#13 0x4045038e in php_mysql_do_connect (ht=3, return_value=0x81b95ec,
this_ptr=0x0, return_value_used=1, tsrm_ls=0x8173370,
persistent=0) at php_mysql.c:662
#14 0x40450588 in zif_mysql_connect (ht=3, return_value=0x81b95ec,
this_ptr=0x0, return_value_used=1, tsrm_ls=0x8173370)
at php_mysql.c:714
#15 0x4041d8b8 in execute (op_array=0x81b45ec, tsrm_ls=0x8173370) at
./zend_execute.c:1598
#16 0x4042c562 in zend_execute_scripts (type=8, tsrm_ls=0x8173370,
retval=0x0, file_count=3) at zend.c:810
#17 0x40439b12 in php_execute_script (primary_file=0xbf5ff92c,
tsrm_ls=0x8173370) at main.c:1381
#18 0x40436455 in php_output_filter (f=0x819e040, bb=0x819e238) at
sapi_apache2.c:401
#19 0x08087daf in ap_pass_brigade (next=0x819e040, bb=0x819e170) at
util_filter.c:534
#20 0x0808e06c in default_handler (r=0x816f3b0) at core.c:3276
#21 0x0807dc62 in ap_run_handler (r=0x816f3b0) at config.c:193
#22 0x0807e11d in ap_invoke_handler (r=0x816f3b0) at config.c:373
#23 0x0806cb23 in ap_process_request (r=0x816f3b0) at
http_request.c:257
#24 0x08068d15 in ap_process_http_connection (c=0x816d480) at
http_core.c:291
#25 0x08086386 in ap_run_process_connection (c=0x816d480) at
connection.c:85
#26 0x0807afca in process_socket (p=0x816d370, sock=0x816d3a8,
my_child_num=0, my_thread_num=0, bucket_alloc=0x816b2f8)
at worker.c:631
#27 0x0807b57d in worker_thread (thd=0x810b2d0, dummy=0x8168940) at
worker.c:945
#28 0x40212644 in dummy_worker (opaque=0x810b2d0) at thread.c:127
#29 0x4028df87 in pthread_start_thread (arg=0xbf5ffc00) at
manager.c:284
The work around I'm using is putting the database name in the
/etc/hosts file and that appears to be working. It's really wacky.
The scripts run fine with the standalone version of php so it's
definatly the interaction with apache. (sapi/apache2filter)
Thanks,
-Ryan
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18515&edit=1