SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: HTTP error 500

  1. #1
    SitePoint Enthusiast HitRaj 47's Avatar
    Join Date
    Nov 2005
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTTP error 500

    I am getting a HTTP error 500 error whilst trying to display my web page. The hosting company I am using is http://www.bytehost.com and they are running PHP 5.2.9.

    I am using this free host for a college project, but I do have my own paid hosting. The thing is, it displays correctly on my own hosting, which is also on PHP 5.

    The page I am trying to display is using the Smarty templating engine. The error seems to be with the display() method of the Smarty() class, because when I commented it out, the page displayed but with PHP errors.

    Here is my index.php code:

    PHP Code:
    <?php

    // Require the Smarty template file
    require_once('inc/smarty/Smarty.class.php');

    // Initialize new template
    $template = new Smarty();

    // Configure Smarty templtae variables
    $template->template_dir 'inc/smarty/templates';
    $template->compile_dir 'inc/smarty/templates_c';
    $template->cache_dir 'inc/smarty/cache';
    $template->config_dir 'inc/smarty/configs';

    // Create page variables
    $page_title 'Welcome';    // Page title
    $site_url 'http://stiefel.byethost5.com';    // Web site base URL
    $site_css 'stiefel_default.css';    // CSS file to use
    $employee_login '<a href="#">Employee Login</a>';    // Employee login link

    // Navigation bar
    $navlist '<ul id="navlist">
                <li><a href="#">Home</a></li>
                <li><a href="#">Products</a>
                     <ul class="submenu">
                           <li><a href="#">Search</a></li>
                        <li><a href="#">View all products</a></li>
                    </ul>
                </li>
                <li><a href="#">Blog</a></li>
                <li><a href="#">Contact Us</a></li>
                </ul>'
    ;
                
    // Customer login
    $customer_login '<form id="form1" method="post" action="">
          <p>Customer Login:</p>
          <p>
            <label>Username:
              <input type="text" name="username" id="username" />
            </label>
          </p>
          <p>
            <label>Password:
              <input type="text" name="password" id="password" />
            </label>
          </p>
          <p>
              <input type="submit" name="login" id="login" value="Login" />
              <br />
              <a href="#">Register</a> | <a href="#">Forgot password</a>
          </p>
        </form>'
    ;
        
    // Page content
    $page_content '<p>Welcome to Stiefel Laboratories home page. Give us all your money and we will supply you with drugs.</p>';

    // Assign template variables
    $template->assign'page_title'$page_title );
    $template->assign'site_url'$site_url );
    $template->assign'site_css'$site_css );
    $template->assign'employee_login'$employee_login );
    $template->assign'navlist'$navlist );
    $template->assign'customer_login'$customer_login );
    $template->assign'page_content'$page_content );

    // Display template
    $template->display('stiefel.tpl');

    ?>
    The phpinfo() page for my free hosting is located here, if it helps: http://stiefel.byethost5.com/potatoes.php

    Thanks for any help!
    Beware of Raj - My Portfolio and Blog.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is there anything in your error_log?

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Did you have to upload a .htaccess file?

    That is one of the biggest provider of 500s in my limited experience.

    (If you suspect this is the case and you want to debug it, U may need to tell the .htaccess to log errors though, or just remove it for a while)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •