The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

500 errors

Discussion in 'General Discussion' started by Zion Ahead, Jan 21, 2007.

  1. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    I get a 500 Internal server error when loading a site. I do have phpsuexec enabled, php5.

    Code:
    drwxr-xr-x  10 username username 4.0K Jan 20 17:13 ./
    drwx--x--x  42 root    root    4.0K Jan 20 00:46 ../
    -rw-r--r--   1 username username   24 Jan 19 17:56 .bash_logout
    -rw-r--r--   1 username username  191 Jan 19 17:56 .bash_profile
    -rw-r--r--   1 username username  124 Jan 19 17:56 .bashrc
    -rw-------   1 username username   22 Jan 20 06:04 .contactemail
    drwxr-xr-x   4 username username 4.0K Jan 20 17:13 cpanel3-skel/
    drwx------   2 username username 4.0K Jan 21 11:57 .cpanel-datastore/
    drwxr-xr-x   3 username username 4.0K Jan 20 11:31 etc/
    drwxr-xr-x   2 username username 4.0K Jan 20 17:06 .htpasswds/
    -rw-------   1 username username   12 Jan 21 11:57 .lastlogin
    drwxr-x---  10 username mail    4.0K Jan 20 15:58 mail/
    drwxr-x---   3 username username 4.0K Dec 22 11:58 public_ftp/
    drwxr-x---  13 username nobody  4.0K Jan 21 01:11 public_html/
    drwxr-xr-x   7 username username 4.0K Jan 20 18:19 tmp/
    lrwxrwxrwx   1 username username   11 Jan 19 17:56 www -> public_html/
    Code:
    drwxr-x---  13 username nobody  4.0K Jan 21 12:06 ./
    drwxr-xr-x  10 username username 4.0K Jan 20 17:13 ../
    drwxr-xr-x   2 username username 4.0K Jan 20 16:57 cgi-bin/
    drwxr-xr-x   2 username username 4.0K Jan 21 12:07 common/
    -rwxr-xr-x   1 username username  874 Jan 21 12:05 contact.php*
    -rwxr-xr-x   1 username username 1.3K Jan 21 12:05 copyright.php*
    drwxr-xr-x   2 username username 4.0K Jan 20 17:02 css/
    -rwxr-xr-x   1 username username 4.9K Jan 21 12:05 display_category.php*
    -rwxr-xr-x   1 username username 1.9K Jan 21 12:05 display_item.php*
    drwxr-xr-x   2 username username 4.0K Jan 20 16:57 drupal/
    drwxr-xr-x   3 username username 4.0K Jan 20 17:02 dtd/
    drwxr-xr-x   2 username username 4.0K Jan 20 17:02 files/
    -rwxr-xr-x   1 username username   21 Jan 21 12:05 .htaccess*
    drwxr-xr-x   5 username username 4.0K Jan 20 17:25 images/
    -rwxr-xr-x   1 username username 3.9K Jan 21 12:06 index.php*
    -rwxr-xr-x   1 username username 1.3K Jan 21 12:06 login.php*
    -rwxr-xr-x   1 username username 4.4K Jan 21 12:06 news_archive.php*
    -rwxr-xr-x   1 username username 2.6K Jan 21 12:06 news_current.php*
    drwxr-xr-x   3 username username 4.0K Jan 20 17:25 oldsites/
    drwxr-xr-x   5 username username 4.0K Jan 20 17:33 portfolio/
    drwxr-xr-x   3 username username 4.0K Jan 20 17:34 sites/
    drwxr-xr-x   2 username username 4.0K Jan 21 01:11 suspended.page/
    .htaccess file:

    Options All -Indexes


    What could be the problem? I am unable to find any details in the logs.
     
  2. chris8lunch

    chris8lunch Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    160
    Likes Received:
    0
    Trophy Points:
    16
    Try setting public_html permissions to 755
     
  3. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    I tried...same problem unfortunately
     
  4. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    apache error logs:

    [Sun Jan 21 16:16:06 2007] [error] [client xxx.96.77.143] Premature end of script headers: /home/coopera/public_html/client/index.php
    [Sun Jan 21 16:16:06 2007] [error] [client xxx.96.77.143] File does not exist: /home/coopera/public_html/client/500.shtml
    [Sun Jan 21 16:17:59 2007] [error] [client xxx.96.77.143] File does not exist: /home/coopera/public_html/client/cpanl
    [Sun Jan 21 16:17:59 2007] [error] [client xxx.96.77.143] File does not exist: /home/coopera/public_html/client/404.shtml
     
  5. dafut

    dafut Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    Not sure, not enough info, but have you checked your index.php page to make sure there are no leading or trailing spaces or lines before the opening "<?php "or closing "?>"(first or last) lines?

    Seems like I've seen this before (and it was actually a php include that caused the error due to spaces after the closing ">".
     
  6. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    index.php file

    Code:
    
    <?php
    
    // Get session info.
    session_start();
    // Check that i'm logged in
    if (@!isset($_SESSION['authid'])) {
            // Not actually used. Though here for completeness
    }
    
    // Set up the database connection ready for use.
    require("common/ab.inc.php");
    $connection = mysql_connect($host, $user, $password) or die ("Could not connect to Server.");
    $db = mysql_select_db($database, $connection) or die ("Could not select database.");
    
    // Do queries necessary for page.
    // Query for items available to display. Only return 3 values in descending order.
    $sql = "SELECT tbl_items.*, tbl_categories.name FROM tbl_items, tbl_categories WHERE tbl_items.cat = tbl_categories.id AND tbl_categories.type = 'News' ORDER BY tbl_items.id DESC$
    $newsinbrief = mysql_query($sql) or die("Couldn't execute query.");
    
    ?>
    <?php include("common/head.php"); ?>
    
                            <h2 id="pageTitleStrip">Welcome</h2>
    
                            <div class="item trans95">
                                    <h3 class="date"></h3>
                                    <h3>The Portfolio web-site of SoSo</h3>
                                    <div class="text">
                                            <div class="divider">
                                                    <img class="icon left" src="images/icons/kdmconfig.png" alt="User Icon Icon" width="48" height="48" />
                                                    <p>I hold an BSc (hons) degree in Computer Science (2:1) and have a keen interest in website and
                                                    web-application design and development, focusing on graphical design. My technical skills are centred
                                                    around a thorough understanding of Object Orientated analysis, design and programming techniques.</p>
    
                                                    <p>I specialise in User Interface design and construction using HCI methodologies and am capable of producing
                                                    multi-threaded Java/Swing applications, Java Web Services using the Struts and Hibernate frameworks, and
                                                    JSR168 compliant portlets and portal systems.</p>
    
                                                    <p>I am a good team player and am able to work independently. I look forward to the prospect of working
                                                    in an industry where my current skill set can be put to good use and expanded upon.</p>
                                            </div>
                                    </div>
                                    <ul class="moreLinks">
                                            <li class="category"><a href="display_category.php?id=10" title="View CV">View/Download a CV</a></li>
                                            <li></li>
                                    </ul>
                            </div>
    
                            <?php
                                    if ($myrow = mysql_fetch_array($newsinbrief)) {
                                            do {
                            ?>
    
                            <div class="item trans95">
                                    <h3 class="date"><?php echo $myrow["date"] ?></h3>
                                    <h3><?php echo $myrow["title"] ?></h3>
                                    <div class="text">
                                            <div class="divider">
                                                    <img class="icon left" src="images/icons/<?php echo $myrow["icon"] ?>" alt="Item Icon" width="48" height="48" />
                                                    <?php echo $myrow["text"] ?>
                                            </div>
                                    </div>
                                    <ul class="moreLinks">
                                            <li class="category">
                                                    <a href="display_category.php?id=<?php echo $myrow["cat"] ?>" title="Display the items in this category"><?php echo $myrow["name"]$
                                            </li>
                                            <li>
                                                    <?php if ($myrow['file']!="") { ?>
                                                            <a href="display_item.php?id=<?php echo $myrow["id"] ?>" title="Display rest of item">More...</a>
                                                    <?php   } else { ?>
                                                            More...
                                                    <?php } ?>
                                            </li>
                                    </ul>
                            </div>
    
                            <?php
                                            } while ($myrow = mysql_fetch_array($newsinbrief));
                                    } else {
                            ?>
    
                            <div class="item trans95">
                                    <h3 class="date"><?php echo date("Y-m-d H:i:s"); ?></h3>
                                    <h3>No Results Returned</h3>
                                    <div class="text">
                                            <div class="divider">
                                                    <img class="icon left" src="images/icons/help_index.png" alt="Error Icon" width="48" height="48" />                               $
                                                    <p>I'm sorry but there were no results returned from the database for the category you searched for.
                                                    Perhaps no article/news items have been created. Please check back again later.</p>
                                            </div>
                                    </div>
                                    <ul class="moreLinks">
                                            <li class="category">Error</li>
                                            <li>More...</li>
                                    </ul>
                            </div>
    
                            <?php
                                    }
                            ?>
    
                            <div id="itemNav">
                                    <ul class="pagiation">
                                            <li><a href="news_current.php" title="View more news items">More News</a></li>
                                    </ul>
                            </div>
    
    <?php include("common/tail.php"); ?>
    
     
  7. devGOD

    devGOD Well-Known Member

    Joined:
    Oct 18, 2003
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    did you ever find out what is causing the problem? i'm having the same issure
     
  8. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    after upgrading to php 4.4.5, it happened again (so far one mentioned domain reported)

    drwxr-x--- 11 user nobody 4.0K Sep 1 17:51 public_html/

    .htaccess is empty in public_html also

    I already ran chownpublichtmls also

    apache error log:

    [Thu Feb 22 17:04:50 2007] [error] [client xxx] Premature end of script headers: /home/user/public_html/index.php
    [Thu Feb 22 17:04:50 2007] [error] [client xxx] File does not exist: /home/user/public_html/500.shtml

    I also confirmed this is in httpd.conf

    AddHandler application/x-httpd-php .php .php4 .php3

    I ran as well;

    /scripts/fixsuexeccgiscripts
    /scripts/enablefileprotect
    service httpd restart
     
    #8 Zion Ahead, Feb 22, 2007
    Last edited: Feb 22, 2007
  9. budway

    budway Well-Known Member

    Joined:
    Apr 16, 2003
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
  10. jugo

    jugo Active Member

    Joined:
    Nov 23, 2005
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Also...


    CHOWN public_html to username:username
     
Loading...

Share This Page