Segmentation Fault on Apache with PHP4 module

From: Date: Wed, 21 Jun 2000 18:32:44 +0000
Subject: Segmentation Fault on Apache with PHP4 module
Groups: php.dev php.general 
Request: Send a blank email to php-dev+get-21926@lists.php.net to get a copy of this message
This is wierd. We just upgraded to PHP4 which may or may not be related. When I try to load a page which had previously worked with RC2, it throws the following error to the apache error logs: [Wed Jun 21 12:26:05 2000] [notice] child pid 29098 exit signal Segmentation fault (11) I'm not doing anything out of the ordinary with the PHP code either. The HTML starts to display in the browser and then terminates. If you'd like to see it, go to http://controlpanel.webpipe.net . You don't need a user/pass right now. I'll attach the complete code. Any suggestions??? Jason

<? //testing... $domain = "testdomain.com"; $rootDir = "/home/testdomain.com"; $user = "blah"; $pass = "blah"; //If the current dir is not set, set do doc root if (!isset($currentDir)) { //$currentDir= "/test"; $currentDir=""; } //User dir is full path of current dir $userDir = $rootDir.$currentDir; //Recieve incoming upload and move to current directiory if (isset($file) && $file != "none") { exec("ssu -u $user -p $pass -c 'cp $file $userDir/$file_name'"); exec("cp $file /tmp/{$file_name}1"); exec("ssu -u $user -p $pass -c 'chgrp users $userDir/$file_name'"); $file = "none"; } //Create new directory if (isset($dirName)) { exec("ssu -u $user -p $pass -c 'mkdir $userDir/$dirName'"); } //Get contents of current dir exec("ssu -u $user -p $pass -c 'ls $userDir'",$dir_content,$returnVal); if($returnVal == 1) { echo"Unable to process request.<br>"; echo"This directory either doesn't exist or you don't have permission to view its contents.<br>"; } ?> <html> <head> <title>Lil' Admin Buddy</title> <script language=JavaScript>; function openWin(URL) { modWin = window.open(URL,"Modify", "toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,scrollbars=no,width=520,height=480"); modWin.focus(); } function createDir(formName) { newDir = prompt("Enter the name of the new directory",""); if(newDir != null) { if(newDir.length > 20) { tempDir = newDir; newDir = tempDir.substring(0,20); } if(newDir != '') { formName.dirName.value = newDir; formName.submit(); } } return true; } </script> </head> <body> <!---------- Title Bar ----------> <table width="800" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <td width="22" align="right"> <img src="images/tl_corner.gif" height="22" width="22"></td> <td background="images/title_bg.gif" align="center" height="22" width="756"> <table border=0 width="95%"> <tr> <td align="left"> <font face="tahoma,verdana,arial,helvetica,sans-serif" color="#ffffff" size="-1"><b>Welcome to <? echo $domain; ?></b></font></td> <td align="right"> <font face="tahoma,verdana,arial,helvetica,sans-serif" color="#ffffff" size="-1"><? echo gmdate ("l F jS, Y -- H:i:s"); ?> GMT</font></td></tr> </table></td> <td width="22"> <img src="images/tr_corner.gif" height="22" width="22"></td></tr> </table> <!---------- Menu ----------> <table width="800" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <td background="images/lft_border.gif" width="22" align="center"> <img src="images/spacer.gif" height="5" width="22"></td> <td align="center" width="756"> <table border=0 cellpadding=0 cellspacing=0 width="500" align="center"> <tr align="center"> <td> <a href="browse.php"> <img src="images/file_admin.gif" height="60" width="60" border="0"></a></td> <td> <img src="images/stats.gif" height="60" width="60" border="0"></td> <td> <a href="virtchange.php"> <img src="images/mail_mgr.gif" height="60" width="60" border="0"></a></td> <td> <img src="images/support.gif" height="60" width="60" border="0"></td> <td> <a href="index.php"> <img src="images/logout.gif" height="60" width="60" border="0"></a></td></tr> </table> </td> <td background="images/rt_border.gif" width="22"> <img src="images/spacer.gif" height="20" width="22"></td></tr> </table> <!---------- File Header ----------> <table width="800" height="35" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <td height="35" width="22" align="right"> <img src="images/tabbar_lft.gif" height="35" width="22"></td> <td background="images/bar_bg.gif" height="35" width="756"> <table border=0 width="100%" align="center" cellpadding=0 cellspacing=0> <tr valign="center"> <td width="25%" align="left"> <? if ($userDir != $rootDir) { echo "<form method=\"POST\" action=\"$PHP_SELF\">"; echo "<input type=\"image\" src=\"images/levelup.gif\" alt=\"To Parent Dir\" border=0>"; echo "<input type=\"hidden\" name=\"currentDir\" value=\"".$previousDir."\">"; echo "<input type=\"hidden\" name=\"rootDir\" value=\"".$rootDir."\">"; echo "</td></form>\n"; } else echo"<img src=\"images/spacer.gif\" width=\"80\" height=\"32\"></td>"; ?> <td width="50%" align="center"> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1">Contents of: &nbsp;<? echo $userDir; ?></font></td> <td width="12%" align="center" valign="center"> <a href="javascript:createDir('dir');"> <img src="images/mkdir.gif" width="85" height="24" border="0"></a></td> <td width="13%" align="center" valign="center"> <form method="POST" action"<? echo $PHP_SELF; ?>"> <input type="hidden" name="currentDir" value="<? echo $currentDir; ?>"> <input type="hidden" name="rootDir" value="<? echo $rootDir; ?>"> <input type="hidden" name="previousDir" value="<? echo $previousDir; ?>"> <input type="image" src="images/refresh.gif" alt="Refresh" border=0> </td> </tr></form> </table></td> <td height="35" width="22"> <img src="images/tabbar_rt.gif" height="35" width="22"></td></tr> </table> <!---------- Content ----------> <table width="800" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <!-- The HTML terminates here and prints "<td background='ima'" ---> <td background="images/lft_border.gif" width="22" align="right"> <img src="images/spacer.gif" height="5" width="22"></td> <td width="756"> <table border=0 width="85%" align=center> <tr> <td><img src="images/spacer.gif" width="1" height="1" border=0></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Name</u></b></font></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Owner</u></b></font></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Group</u></b></font></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Permissions</u></b></font></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Size</u></b></font></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Last Modified</u></b></font></td> <td> <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1" color="#003366"><b><u>Modify</u></b></font></td></tr> <? for($i =0; $i < count($dir_content); $i++) { $file = $userDir."/".$dir_content[$i]; echo "<tr><TD align=center height=24>"; if (is_dir($file)) { echo "<form method=\"POST\" action=\"$PHP_SELF\">"; echo "<input type=\"image\" src=\"images/folder.gif\" alt=\"change to $dir_content[$i]\" border=0>"; echo "<input type=\"hidden\" name=\"currentDir\" value=\"".$currentDir."/".$dir_content[$i]."\">"; echo "<input type=\"hidden\" name=\"rootDir\" value=\"".$rootDir."\">"; echo "<input type=\"hidden\" name=\"previousDir\" value=\"".$currentDir."\">"; echo "</td></form>\n"; } else { echo "<IMG src=\"images/file.gif\" border width=30 height=24 alt=\"$dir_content[$i]\"></TD>\n"; } echo "<TD><FONT face=arial size=2>$dir_content[$i]</font></td>\n"; $owner_info = posix_getpwuid(fileowner($file)); echo "<TD><FONT face=arial size=2>".$owner_info["name"]."</FONT></TD>\n"; $group_info = posix_getgrgid(filegroup($file)); echo "<TD><FONT face=arial size=2>".$group_info["name"]."</FONT></TD>\n"; //Get file permissions $mode = fileperms($file); /* Determine permissions */ $owner["read"] = ($mode & 00400) ? 'r' : '-'; $owner["write"] = ($mode & 00200) ? 'w' : '-'; $owner["execute"] = ($mode & 00100) ? 'x' : '-'; $group["read"] = ($mode & 00040) ? 'r' : '-'; $group["write"] = ($mode & 00020) ? 'w' : '-'; $group["execute"] = ($mode & 00010) ? 'x' : '-'; $world["read"] = ($mode & 00004) ? 'r' : '-'; $world["write"] = ($mode & 00002) ? 'w' : '-'; $world["execute"] = ($mode & 00001) ? 'x' : '-'; echo "<TD><FONT face=arial size=2>"; echo $owner["read"].$owner["write"].$owner["execute"]; echo $group["read"].$group["write"].$group["execute"]; echo $world["read"].$world["write"].$world["execute"]."</FONT></TD>\n"; $size = filesize($file); echo "<TD><FONT face=arial size=2>$size Bytes</FONT></TD>\n"; $mdate = date("M j G:i",filemtime($file)); echo "<TD><FONT face=arial size=2>$mdate</FONT></TD>\n"; echo "<td><font face=arial size=1 color=\"#003399\">"; echo "<a href=\"javascript:openWin('modify.php?file=$file&file_name=$dir_content[$i]');\">Modify</a></font>"; echo "</td></tr>\n"; } ?> </table></td> <td background="images/rt_border.gif" width="22"> <img src="images/spacer.gif" height="5" width="22"></td></tr> </table> <!---------- Divider Bar ----------> <table width="800" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <td height="35" width="22" align="right"> <img src="images/tabbar_lft.gif" height="35" width="22"></td> <td background="images/bar_bg.gif" height="35" width="756"> <img src="images/spacer.gif" height="5" width="5"></td> <td height="35" width="22"> <img src="images/tabbar_rt.gif" height="35" width="22"></td></tr> </table> <!---------- Upload Function ----------> <table width="800" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <td background="images/lft_border.gif" width="22" align="right"> <img src="images/spacer.gif" height="5" width="1"></td> <td width="756"> <font size="-1" face="tahoma,verdana,arial,helvetica,sans-serif"><b>Upload a File to this Directory:</b></font> <br> <form method="POST" action="<? echo $PHP_SELF; ?>" enctype="multipart/form-data"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000000"> <input type="hidden" name="currentDir" value="<? echo $currentDir; ?>"> <input type="hidden" name="rootDir" value="<? echo $rootDir; ?>"> <input type="hidden" name="previousDir" value="<? echo $previousDir; ?>"> <input type=file name=file>&nbsp;&nbsp;&nbsp;&nbsp; <input type=image src="images/upload.gif" alt="Upload this File" border=0><br> <font face="helvetica,arial,sans-serif" size="1"><b> This may take a while depending on the file size and the speed of your internet connection.</b></font> </form></td> <td background="images/rt_border.gif" width="22"> <img src="images/spacer.gif" height="5" width="22"></td></tr> </table> <!---------- Bottom w/Logout ----------> <table width="800" cellpadding=0 cellspacing=0 border=0 align=center valign=top alink="#003399" link="#003399" vlink="#003399"> <tr> <td width="22" height="22" align="right" width="22"> <img src="images/bl_corner.gif" height="22" width="22"></td> <td background="images/title_bg.gif" height="22" align="center" width="756"> <img src="images/logout_sm.gif" height="22" width="75" border="0"></td> <td widht="22" height="22" width="22"> <img src="images/br_corner.gif" height="22" width="22"></td></tr> </table> <!---------- Footer ----------> <br> <table border=0 width="800" align="center"> <tr valign="top"> <td align="left"> <font size="-2" face="tahoma,verdana,arial,helvetica,sans-serif">Lil' Admin Buddy ver. 1.0.0 &nbsp;&nbsp;&nbsp; Copyright &copy; 2000 Techsource, Inc. All rights reserved.<BR> All Lil' Buddy Software is released under the GNU <A HREF="license.html">General Public License</A><BR> The Lil' Buddy Family is hosted and maintained <a href="http://www.webpipe.net">Webpipe.net</a>. &nbsp; For more information on Webpipe.net services, go to <a href="http://www.webpipe.net/lib/services.php">www.webpipe.net</a><br> Commercial support for this product is provided by Webpipe.net. For more information, visit <a href="http://www.lilbuddy.org/">lilbuddy.org</a></font></td> <td align="right"> <a href="http://www.lilbuddy.org/"><img src="images/lilbuddypower.gif" height="52" width="127" border=0></a></td></tr> </table> <form method="POST" action="<? echo $PHP_SELF; ?>" name="dir"> <input type="hidden" name="dirName" value=""> <input type="hidden" name="currentDir" value="<? echo $currentDir; ?>"> <input type="hidden" name="rootDir" value="<? echo $rootDir; ?>"> <input type="hidden" name="previousDir" value="<? echo $previousDir; ?>"> </form> </body> </html>
« previous php.dev (#21926) next »