Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Help needed

 
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial)
View previous topic :: View next topic  
Author Message
Smarty002
Smarty n00b


Joined: 08 Jun 2019
Posts: 2

PostPosted: Sat Jun 08, 2019 6:39 pm    Post subject: Help needed Reply with quote

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
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 218
Location: West Coast

PostPosted: Sun Jun 09, 2019 10:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1518

PostPosted: Mon Jun 10, 2019 5:15 am    Post subject: Reply with quote

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
View user's profile Send private message
Smarty002
Smarty n00b


Joined: 08 Jun 2019
Posts: 2

PostPosted: Thu Jun 13, 2019 2:17 pm    Post subject: Reply with quote

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.


Im 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
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 218
Location: West Coast

PostPosted: Thu Jun 13, 2019 2:59 pm    Post subject: Reply with quote

After you instantiate the Smarty class, try using:
Code:
$smartyObject->setErrorReporting(E_ALL);
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1518

PostPosted: Fri Jun 14, 2019 9:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP