Smarty seems to expand tags in header **'use_smarty_php_tags is enabled **

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
DavidOlsen192
New Member
New Member
Posts: 6
Joined: Thu May 08, 2008 5:07 pm

Smarty seems to expand tags in header **'use_smarty_php_tags is enabled **

Post by DavidOlsen192 »

My template includes {php}require_once('includes/db_config.inc.php'); {/php}
but the html produced has the contents of the db_config.inc.php file displayed.  It doesn't interpret the PHP.

Any help will be appreciated.

Thanks,
Dave

I get the following at the beginning of the web page:
<?
//Troubleshooting:
//echo "This is the config file";

//---------------------------------------------
//---------------------------------------------
//Set the variables below for each site:

//Choose the includes directory for the CMS
$includesPath = "/home/kris/includes/";

//Choose a default language by commenting and uncommenting:
$defaultLang  = "eng";
//$defaultLang  = "jap";

//Setup the database connection
Last edited by DavidOlsen192 on Sat May 10, 2008 2:00 am, edited 1 time in total.
rvdv
Forum Members
Forum Members
Posts: 62
Joined: Wed Oct 31, 2007 2:16 pm

Re: Smarty seems to expand tags in header but php is not executed

Post by rvdv »

A quote from the developers documentation:
To enable this functionality, you need to change one line of the config.php file in your installation. Change the "use_smarty_php_tags" setting to true. i.e.:

  #Allow smarty {php} tags?  These could be dangerous if you don't trust your users.
  $config['use_smarty_php_tags'] = true;
DavidOlsen192
New Member
New Member
Posts: 6
Joined: Thu May 08, 2008 5:07 pm

Re: Smarty seems to expand tags in header but php is not executed

Post by DavidOlsen192 »

Sorry, I thought I mentioned that (it was late).  Smarty tags are turned on in config.php. I am using php 5.1.6 on a CentOS 4.6 server.  I don't have root.

Is there a simple way to test that Smarty is actually working?

If I have the flag enabled but am still having this problem is it a fairly sure thing that I have Smarty misconfigured?

I am moving a website from one server to another and have never used Smarty or CMS so I am dealing with a learning curve.

Thanks,
Dave
Post Reply

Return to “CMSMS Core”