Star2Billing / a2billing

A2Billing is a telecom switch and billing system capable of providing and billing a range of telecom products and services to customers such as calling card products, residential and wholesale VoIP termination, DID resale and callback services.
www.asterisk2billing.org
Other
180 stars 174 forks source link

Smarty error after install #124

Closed jkazar closed 8 years ago

jkazar commented 8 years ago

Hi,

Just completed the installation on Ubuntu.

blank screen at: http:///a2billing/admin

the error message is:

PHP Fatal error: Uncaught --> Smarty: Unable to load template file 'index.tpl' <-- \n thrown in /var/www/html/a2billing/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 139

What am I missing?

jkazar commented 8 years ago

I have found a solution: In: common/lib/admin.smarty.php, I changed the code, I changed:

$smarty->template_dir = TEMPLATE_DIR . $skin_name.'/';

to:

$smarty->setTemplateDir(TEMPLATE_DIR . $skin_name.'/');

It seems, that in smarty 3.1 we have to use the second line.

jkazar commented 8 years ago

I have made other changes related to this:

grep smarty->template_dir * -r grep smarty->compile_dir * -r grep smarty->plugins_dir * -r

common/lib/customer.smarty.php common/lib/admin.smarty.php common/lib/agent.smarty.php

All three files contain these three lines:

$smarty->template_dir = TEMPLATE_DIR . $skin_name.'/'; $smarty->compile_dir = TEMPLATE_C_DIR; $smarty->plugins_dir= "./plugins/";

instead we should use from SMARTY 3.1:

$smarty->setTemplateDir(TEMPLATE_DIR . $skin_name.'/'); $smarty->setCompileDir(TEMPLATE_C_DIR); $smarty->setPluginsDir("./plugins/");

These changes are the minimum necessary.

goodarzi commented 8 years ago

Thank you jkazar , I had same issue on centos and your solution works well.

areski commented 8 years ago

Thanks for the resolution. Applied here https://github.com/Star2Billing/a2billing/commit/b29fbdd9f0cc5f72e0e664c3e76f4e795c22453f