1

I am using Apache 2.2. When I am trying to run it my browser is failing to run it, it's showing:

 This webpage is not available
 The connection to localhost was interrupted.
 Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.

My PHP code:

<?php
error_reporting(E_STRICT | E_ALL);
include_once $_SERVER['DOCUMENT_ROOT'].'/include/db.inc.php' ;
$sql="select post_id,post_title,post_desc,post_date,course,semester,firstname,lastname FROM wbut_forum_posts left join users on post_by = email ORDER BY post_id DESC LIMIT 25";
$result = mysqli_query($link,$sql );

if (!$result)
{
    include_once "wall.html.php";
    echo'<tr><td align="center"> OOOOPPPPPSSS!!!SORRY,UNABLE TO DISPLAY LATEST 25 TOPICS</td></tr>';
    exit();
}
$allposts = array();
while ($row = mysqli_fetch_array($result))
{
    $allposts[] = array( 'p_id' => $row['post_id'],'p_title' => $row['post_title'],'p_desc' => $row['post_desc'],'p_date' => $row['post_date'],'p_course' => $row['course'],'p_semester' => $row['semester'],'p_firstname' => $row['firstname'],'p_lastname' => $row['lastname']);
}
foreach ($allposts as $posts) :
?>

<table border="0" cellpadding="0px" cellspacing="0px">
<tr>
<td align="left"> <span class="style5"><?php echo $posts[p_firstname] . " " . $posts[p_laststname] ; ?></span></td>
<?php
 $id=urlencode($posts[p_id]);
 $title=urlencode($posts[p_title]);
 $date=urlencode($posts[p_date]);
 $course=urlencode($posts[p_course]);
 $semester=urlencode($posts[p_semester]);
 $firstname=urlencode($posts[p_firstname]);
 $lastname=urlencode($posts[p_lastname]);
 ?>
 <td align="center" >
        <a href="view.html.php?id=<?php echo "$id" ?>&amp;title=<?php echo "$title" ?>&amp;date=<?php echo "$date" ?>&amp;course=<?php echo "$course" ?>&amp;semester=<?php echo "$semester" ?>&amp;firstname=<?php echo "$firstname" ?>&amp;lastname=<?php echo "$lastname" ?>&amp;" title="VIEW POST">
            VIEW THE FULL POST AND REPLY HERE
        </a>
</td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td>
        <span class="style6"><?php echo $posts[p_title] ; ?></span>
    </td>
</tr>
<tr>
    <td align="right"><?php echo $posts[p_date] ; ?></td>
    <td align="center">
        <PRE>RELATED COURSE  : <span class="style7"><?php echo $posts[p_course] ; ?></span> AND RELATED SEMESTER :  <?php echo $posts[p_semester] ; ?></PRE>
    </td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td><span class="style17"><?php echo $posts[p_desc] ; ?></span></td>
</tr>
</table>
<?php endforeach; ?>

The error:

This webpage is not available
The connection to localhost was interrupted.
Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.

Is it an Apache problem? If so then how to fix it?

8
  • Seems like your server is having the hiccups when running your script? Have you checked your log files?
    – thaJeztah
    Mar 30 '13 at 15:44
  • no.how to check it?
    – Ritabrata Gautam
    Mar 30 '13 at 15:45
  • Depends on what kind of server you are running (XAMP/MAMP other?). Best to google around a bit or check the documentation. There are lots of other 'Error 101' questions here on StackOverflow, may be worth to check them as well?
    – thaJeztah
    Mar 30 '13 at 15:50
  • i have checked them all..i am using apache 2.2
    – Ritabrata Gautam
    Mar 30 '13 at 15:56
  • Try to narrow down the problem. First try to find the logfiles and check them. Are you able to visit other pages on the same server? E.g. Put a regular HTML file on the server and try to open that inside your browser. Empty your Browser-cache, just to be sure.
    – thaJeztah
    Mar 30 '13 at 16:00
1

This is a problem that can crop up now and then with Apache, especially where it has been packaged into a stack such as XAMPP or WAMP. I have found the best option in these instances is to uninstall the software and reinstall a clean copy. Can't confirm exactly what the root cause is but I have encountered instances where this happens and only affects a small subset of the PHP files in an application and the re-installation of the Apache stack fixes it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.