View previous topic :: View next topic |
Author |
Message |
Smarty002 Smarty n00b
Joined: 08 Jun 2019 Posts: 4
|
Posted: Sat Jun 08, 2019 6:39 pm Post subject: Help needed |
|
|
Hi,
Been struggeling how to get smarty 3 to display the errors.
Code: | public static function muteExpectedErrors()
{
return Smarty_Internal_ErrorHandler::muteExpectedErrors();
} |
can someone help me, im seeing a blank page and want to know where the problem is so i can solve it.
thank you. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Sun Jun 09, 2019 10:54 pm Post subject: |
|
|
A blank page because of a syntax error in Smarty code is not an expected error. So working with muteExpectedErrors() will probably not help you here.
I recommend that in your PHP code, you find where there may be an error handler and get that to tell PHP to display all errors, possibly to also log all errors to an error_log file somewhere. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Jun 10, 2019 5:15 am Post subject: |
|
|
Check your server error log.
If you want to see error in browser, set display_errors to 1 in your php.ini. |
|
Back to top |
|
Smarty002 Smarty n00b
Joined: 08 Jun 2019 Posts: 4
|
Posted: Thu Jun 13, 2019 2:17 pm Post subject: |
|
|
bsmither wrote: | A blank page because of a syntax error in Smarty code is not an expected error. So working with muteExpectedErrors() will probably not help you here.
I recommend that in your PHP code, you find where there may be an error handler and get that to tell PHP to display all errors, possibly to also log all errors to an error_log file somewhere. |
I’m pretty sure its smarty that is not showing the errors. As error logging as error reporting are “on”. Example: i could make .php file and make a error into it and it would display the error but because the template is with smarty its shows blank page. Problem is with smarty not PHP
Can you as the sir who replied show me how to enable smarty error reporting. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Thu Jun 13, 2019 2:59 pm Post subject: |
|
|
After you instantiate the Smarty class, try using:
Code: | $smartyObject->setErrorReporting(E_ALL); |
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Jun 14, 2019 9:19 pm Post subject: |
|
|
Quote: | php-bot: Set 'error_reporting' to -1 and 'display_errors' to 1 in your php.ini and be sure to restart your webserver/fastcgi-listeners. This is more reliable than using ini_set() and error_reporting() in the script, which will fail if there are parse errors. See http://php.net/errorfunc.configuration for more. |
|
|
Back to top |
|
Smarty002 Smarty n00b
Joined: 08 Jun 2019 Posts: 4
|
Posted: Thu Jun 20, 2019 5:44 am Post subject: |
|
|
bsmither wrote: | After you instantiate the Smarty class, try using:
Code: | $smartyObject->setErrorReporting(E_ALL); |
|
Hi where should i put this code? I have insert this code on the page that displays the blank page, but still no error displayed.
AnrDaemon wrote: | Quote: | php-bot: Set 'error_reporting' to -1 and 'display_errors' to 1 in your php.ini and be sure to restart your webserver/fastcgi-listeners. This is more reliable than using ini_set() and error_reporting() in the script, which will fail if there are parse errors. See http://php.net/errorfunc.configuration for more. |
|
Have also done this, and still blank page. Im pretty sure its not PHP but smarty that is not displaying errors. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Thu Jun 20, 2019 5:14 pm Post subject: |
|
|
"Where should i put this code?"
Somewhere in your PHP code will be something like:
$smartyObject = new Smarty();
Add:
$smartyObject->setErrorReporting(E_ALL);
right after that. |
|
Back to top |
|
Smarty002 Smarty n00b
Joined: 08 Jun 2019 Posts: 4
|
Posted: Thu Jun 27, 2019 7:11 am Post subject: |
|
|
bsmither wrote: | "Where should i put this code?"
Somewhere in your PHP code will be something like:
$smartyObject = new Smarty();
Add:
$smartyObject->setErrorReporting(E_ALL);
right after that. |
Well its now working but now i see a error that im not familiar with: Code: | "Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/home/****/Website.nl/admin/admin/categories.tpl" on line 25 "<tr{cycle values=", class="cycle""}>" - Unexpected "cycle", expected one of: "}" <-- thrown in /home/****/website.nl/includes/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 25" |
this is the code i have in my document on, but it should work? Was using smarty 2 previous but have upgraded it to smarty 3. Could it be that things changed? Code: | <tr{cycle values=", class="cycle""}> |
When i delete code everything works.. Hmm |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jun 27, 2019 12:18 pm Post subject: |
|
|
You have broken quotation in there.
|
|
Back to top |
|
|