Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8893617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:17:29+00:00 2026-06-14T23:17:29+00:00

I have designed a very simple PHP app. Works perfectly on localhost (XAMPP /

  • 0

I have designed a very simple PHP app. Works perfectly on localhost (XAMPP / Windows 7) and fails completely on any web server, to which I upload it. Error displayed during failure say nothing to me.

Whatever server configuration is (tested on many) any attempt of run application ends with either:

  • PHP error: unexpected T_STRING in .../template/template.html on line 1,
  • HTTP error 500: Internal Server Error,
  • empty page (assuming, error reporting disabled).

File template/template.html is just an ordinary XHTML file, with correct header, body and structure, containing some simple PHP statements. I load and parse it with require in following function:

public static function renderPartial($view, $data = array())
{
    if(is_file($view))
    {
        if(is_array($data)) extract($data, EXTR_PREFIX_SAME, 'data');

        ob_start(); 
        ob_implicit_flush(false); 

        require($view);

        return ob_get_clean();
    }
    else die('File <strong>"'.$view.'"</strong> does not exist!');
}

It is my own, very simple version of function used in Yii (and probably many other frameworks) to render view, subview or template. I use it in many places in my app and it works like a charm on localhost.

If someone would like to check then here is (should be) live version, while here zipped archive containing SVN exported version right out of my local working copy on localhost, which works here like a dream. (problem solved — examples removed)

I have developed many PHP apps, both in pure PHP or with using Yii framework, and this is first time I have such situation, so I’m quite shocked and lost. Up until now, every application that was running without errors on my localhost (XAMPP) also run without any problems on any webhost.

Any idea or help is higly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:17:30+00:00Added an answer on June 14, 2026 at 11:17 pm

    Check if your Apache server is set to allow short-tags ( <? ?> ) for PHP, because the first line of template.html has short tags (the other tags in the document are all long <?php ?> ). Also, you missed a semi-colon on the line 27 in the same file, at the end of the echo command, should be <?php echo($alert); ?>. Don’t know if it helps anything, but just in case.

    Regards, Hiawatha

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with OpenGl ES 2.0. I've designed a very simple framework
I am basically a windows developer and very new to Sharepoint. I have Designed
I have a very simple chunk of code that is designed to simulate keyboard
I have designed a new web site. I have hosted it online. I want
I'm building a (very) simple FTP app in Cocoa, and I need to store
We have a very lengthy newsletter that has been designed and developed to look
i designed a very simple vb.net application. i would like to my users to
I have a web application originally designed to target IE7. I am readjusting the
I have a series of small library modules designed to handle very specific tasks.
A very simple example. I have two classes: public class BaseControl : UserControl {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.