PHP4 (customer) sessions on Win98

From: Date: Thu, 24 Aug 2000 21:06:47 +0000
Subject: PHP4 (customer) sessions on Win98
Groups: php.qa 
Request: Send a blank email to php-qa+get-1046@lists.php.net to get a copy of this message
Short Version: Has anybody tested the custom session-handler sample code from php.net on Win98 with PHP as an Apache Module or as CGI? I'm having trouble with a PHP DEV version, but it might just be me... Heres the DEV version info: PHP Version 4.0.2-dev System Windows 95/98 4.10 Build Date Aug 16 2000 So long as somebody has tested and QA-ed it, you can ignore me... (Unless you just want to help me figure out what I did stupid/wrong.) This looks remarkably like bug 5621 which was fixed in CVS, but it doesn't seem to be fixed for me... Or, rather, I'm not sure what date it was fixed, and the ChangeLog doesn't mention it by name, but has lots of changes to session stuff within the correct time frame... Long Version: I can't seem to get PHP4 custom session handlers on Win98 to work with PHP CGI or Module still... But I've been having so much trouble lately, I'm not sure what's going on... I'm not even sure if the php.exe, various DLLs and whatnot I'm able to get to work at *all* are what I should have or not... I keep running in circles with different versions. None I've tried seem to do the custom session handlers. Others require debug DLLs I don't have and can't find. (MSVCIRTD.DLL in particular -- I got a DLL with the I and another DLL with the D but not a DLL with both I and D in the name.) In the Module setup, I seem to not get the custom session-writer (from the sample code on php.net documentation) being called when I browse -- and I get a crash from PHP in the more complicated Zend.com custom session-writer. Or, at least, I get a crash followed by the valid HTML output, but no session writer is called, so the timing of the crash is right. Stas says the writer is called after the browser connection is closed, so I wouldn't be seeing it in the browser anyway, and the sample does show php being called from the command line, so I try it with PHP CGI. But then I get two complaints about text sent before cookie headers -- and, no, there is no text before the <?php session_start(); So then I got back to the Module browser/CGI and/or Module setup, and I log the custom session open/read/writes to a file. Sure enough, I get the open and read, but no writer being called in my log file. As far as the text before header issue goes, the first complain doesn't say where the text output happened, and the *second* complaint from session cache limiter claims the initial output is in line 2, which is the line that first complained about output -- which to this naive user means that the first complaint is just plain wrong... The second complaint is saying the first complaint itself was the initial output. In PHP as a Module, standard file-based session support works just fine, but in CGI from the command line I just get the same header errors as a custom session support from CGI. In I also a different crash dialog from the complex Zend.com custom session support. (I guess it might boil down to the same problem, but all the addresses are different...) I guess having no browser to accept the cookie may be the problem for command-line CGI usage, but I don't know how else to try to track down my custom writer problem... Here's the output from standard session from command line: C:\WINDOWS>c:\php4\php -f c:\inetpub\wwwroot\session.php <br> <b>Warning</b>: Cannot send session cookie - headers already sent in <b>c:\inetpub\wwwroot\session.php</b> on line <b>2</b><br> <br> <b>Warning</b>: Cannot send session cache limiter - headers already sent (output started at c:\inetpub\wwwroot\session.php:2) in <b>c:\inetpub\wwwroot\session.php</b> on line <b>2</b><br> Here's the source for my "standard file-based" sessions: <?php session_start(); session_register("foo"); if (!isset($foo)){ echo "Setting foo to 10<BR>\n"; $foo = 10; } else{ echo "I remember foo, it's $foo<BR>\n"; } ?> The customer handler sample code is at http://php.net/manual/function.session-set-save-handler.php which is not linked into the navigation bar, btw. And, finally, here's the output from my phpinfo() call: <CENTER><STYLE TYPE="text/css"><!-- A { text-decoration: none; } A:hover { text-decoration: underline; } H1 { font-family: arial,helvetica,sans-serif; font-size: 18pt; font-weight: bold;} H2 { font-family: arial,helvetica,sans-serif; font-size: 14pt; font-weight: bold;} BODY,TD { font-family: arial,helvetica,sans-serif; font-size: 10pt; } TH { font-family: arial,helvetica,sans-serif; font-size: 11pt; font-weight: bold; } file://--></STYLE> <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000"> <TR VALIGN="middle" BGCOLOR="#9999CC"><TD ALIGN="left"> <a href="http://www.php.net/"><img src="?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" border=0 align="right"></a><H1>PHP Version 4.0.2-dev</H1> </TD></TR> </TABLE><BR> <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000"> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>System</B></td><TD ALIGN="left">Windows 95/98 >4.10</td></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>Build Date</B></td><TD ALIGN="left">Aug 16 2000</td></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>Server API</B></td><TD ALIGN="left">CGI</td></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>Virtual Directory Support</B></td><TD ALIGN="left">enabled</td></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>Configuration File (php.ini) Path</B></td><TD ALIGN="left">php.ini</td></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>ZEND_DEBUG</B></td><TD >ALIGN="left">disabled</td></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF" ><B>Thread Safety</B></td><TD ALIGN="left">enabled</td></TR> </TABLE><BR> <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000"> <TR VALIGN="top" BGCOLOR="#CCCCCC"><TD ALIGN="left"> <a href="http://www.zend.com/"><img src="?=PHPE9568F35-D428-11d2-A769-00AA001ACF42" border="0" align="right"></a> This program makes use of the Zend scripting language engine:<BR>Zend&nbsp;Engine&nbsp;v1.0.1,&nbsp;Copyright&nbsp;(c)&nbsp;1998-2 000&nbsp;Zend&nbsp;Technologies<br></BR> </TD></TR> </TABLE><BR> <HR NOSHADE SIZE=1 WIDTH=600> <a href="?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000"><h1>PHP 4.0 Credits</h1></a> <HR NOSHADE SIZE=1 WIDTH=600> <h1>Configuration</h1> <H2>PHP Core </H2> <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000"> <TR VALIGN="bottom" bgcolor="#9999CC"><TH>Directive</TH><TH>Local Value</TH><TH>Master Value</TH></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>allow_call_time_pass_reference</B><BR></TD><TD ALIGN="center">On</TD><TD ALIGN="center">On</TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>arg_separator</B><BR></TD><TD ALIGN="center">&</TD><TD ALIGN="center">&</TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>asp_tags</B><BR></TD><TD ALIGN="center">Off</TD><TD ALIGN="center">Off</TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>auto_append_file</B><BR></TD><TD ALIGN="center"><i>no value</i></TD><TD ALIGN="center"><i>no value</i></TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>auto_prepend_file</B><BR></TD><TD ALIGN="center"><i>no value</i></TD><TD ALIGN="center"><i>no value</i></TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>browscap</B><BR></TD><TD ALIGN="center"><i>no value</i></TD><TD ALIGN="center"><i>no value</i></TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>default_charset</B><BR></TD><TD ALIGN="center"><i>no value</i></TD><TD ALIGN="center"><i>no value</i></TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>default_mimetype</B><BR></TD><TD ALIGN="center">text/html</TD><TD ALIGN="center">text/html</TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>define_syslog_variables</B><BR></TD><TD ALIGN="center">Off</TD><TD ALIGN="center">Off</TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>disable_functions</B><BR></TD><TD ALIGN="center"><i>no value</i></TD><TD ALIGN="center"><i>no value</i></TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>display_errors</B><BR></TD><TD ALIGN="center">On</TD><TD ALIGN="center">On</TD></TR> <TR VALIGN="baseline" BGCOLOR="#CCCCCC"><TD BGCOLOR="#CCCCFF"><B>doc_root</B><BR></TD><TD ALIGN="center">C:/InetPub/wwwroot And the error output from a custom session in CGI and one in Module: PHP caused an invalid page fault in module MSVCRT.DLL at 017f:78002d15. Registers: EAX=00000004 CS=017f EIP=78002d15 EFLGS=00010202 EBX=ffffff73 SS=0187 ESP=0063ecfc EBP=0063ef58 ECX=ffffffff DS=0187 ESI=7fffffff FS=48ef EDX=00000000 ES=0187 EDI=100ca266 GS=0000 Bytes at CS:EIP: 8b 40 fc c3 53 8b 44 24 14 0b c0 0f 85 ce 1c 01 Stack dump: 78011b4d 0063ef68 00763d40 00000000 fffffff2 00000000 fffffff2 00040340 03380000 03b40334 03080338 7d662beb 0000333e 1d1f7d66 0f237d50 03381d27 APACHE caused an invalid page fault in module PHP4TS.DLL at 017f:008ecefa. Registers: EAX=00000068 CS=017f EIP=008ecefa EFLGS=00010246 EBX=008efa20 SS=0187 ESP=0137fe64 EBP=0137fedc ECX=00000001 DS=0187 ESI=00769f50 FS=4337 EDX=00000000 ES=0187 EDI=00704dfc GS=2c7e Bytes at CS:EIP: 89 02 8b 06 85 c0 74 06 8b 4e 04 89 48 04 a1 48 Stack dump: 00950320 007a2f70 008b7193 00769f60 007a53b0 007a53d0 007a2f70 008b7240 007a2f70 007803a0 008efa44 00000001 00000006 008e7695 00780350 00000000

« previous php.qa (#1046) next »