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

  • SEARCH
  • Home
  • 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 8366927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:02:06+00:00 2026-06-09T13:02:06+00:00

I am migrating a website that is based on Smarty and I tried to

  • 0

I am migrating a website that is based on Smarty and I tried to meet all the prequisites so that there won’t be any problems, but (“as allways” I might add) I have this problem where after installing all the necessary packages the website does not work (I have a HTTP 500 Error in the browser) I found this error in the error log:

PHP Fatal error: Call to a member function createTemplate() on a non-object in /var/www/vhosts/placeholder.com/httpdocs/includes/sysplugins/smarty_internal_templatebase.php on line 47

This actually appears from the index.php file where I have this piece of code

$smarty = new SmartyEC($page->template);
$smarty->display('index.tpl');

The problem is with the display of the index template somewhere but I cannot figure out why.

In order to provide more context my constructor looks like this:

<?php

require 'Smarty.class.php';

class SmartyEC extends Smarty{

    function SmartyEC()
    {
        function __construct()  
        {
            parent::__construct();
            $appname ='website';
            $path= Utils::getTemplatesPath();   
            $this->caching = false;

        }       

    }
}

?>

The server has PHP 5.3.2. installed and the latest version of Smarty also installed. I have checked the configuration paths and changed them accordingly and also the file inclusions.

Thank you in advance!

Update #1

I have tried also to remove the function definition like this:

class SmartyEC extends Smarty {
    public function __construct()  
    {
        parent::__construct();
        $appname ='website';
        $path= Utils::getTemplatesPath();   
        $this->caching = false;
    }
}

but the error now becomes:

Uncaught exception ‘SmartyException’ with message ‘Unable to load
template file ‘index.tpl” in
/var/www/vhosts/website/httpdocs/includes/sysplugins/smarty_internal_templatebase.php:127\nStack
trace:\n#0
/var/www/vhosts/website/httpdocs/includes/sysplugins/smarty_internal_templatebase.php(374):
Smarty_Internal_TemplateBase->fetch(‘index.tpl’, NULL, NULL, NULL,
true)\n#1 /var/www/vhosts/website/httpdocs/index.php(58):
Smarty_Internal_TemplateBase->display(‘index.tpl’)\n#2 {main}\n
thrown in
/var/www/vhosts/website/httpdocs/includes/sysplugins/smarty_internal_templatebase.php
on line 127

Update 2

I found this topic CodeIgniter + Smarty = Error that gives the same error but it is not the same situation as here. More intrigueing is the fact that on the other server it works fine so my guess is that there is a configuration glinch rather than a programming issue.

  • 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-09T13:02:07+00:00Added an answer on June 9, 2026 at 1:02 pm

    Are you sure about the nesting of __construct() within SmartyEC()? (rhetoric question, sorry)

    Had you explicitly named your functions public, the error would have immediately surfaced:

    class SmartyEC extends Smarty {
        public function SmartyEC()
        {
            public function __construct()  
            {
                parent::__construct();
                $appname ='website';
                $path= Utils::getTemplatesPath();   
                $this->caching = false;
            }
        }
    }
    

    gives you

    Parse error: syntax error, unexpected T_PUBLIC in test.php on line 7
    

    As of PHP5 we don’t use class-name-constructors anymore. We use __construct(). Unless you call $ec = new SmartyEC(); $ec->SmartyEC(); explicitly somewhere, that function declaration should be removed:

    class SmartyEC extends Smarty {
        public function __construct()  
        {
            parent::__construct();
            $appname ='website';
            $path= Utils::getTemplatesPath();   
            $this->caching = false;
        }
    }
    

    please also note that your example invocation $smarty = new SmartyEC($page->template); passes an argument – one that neither SmartyEC() nor __construct() expected.

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

Sidebar

Related Questions

I have an older classic ASP website that I am migrating over to IIS7.5.
hey again stackoverflowers I'm migrating a website from old ASP (in VBScript) and there's
I find myself migrating a static site to a WordPress-based website fairly frequently these
Background: We are migrating a website hosted on a dot net based custom CMS
I'm migrating a website from a server that has Apache web-server to another server
I am currently migrating a (working) website to the Windows Azure cloud but am
There is a conversion process that is needed when migrating Visual Studio 2005 web
We are done migrating a website from old CMS to SDL Tridion. We have
I have a server which already host ASP.Net website. I am migrating from blogger
I guess these are all questions that everyone must just know, because I'm not

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.