Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Debugging Smarty App

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
df444
Smarty n00b


Joined: 21 Apr 2019
Posts: 2

PostPosted: Sun Apr 21, 2019 11:07 am    Post subject: Debugging Smarty App Reply with quote

Hi, I'm new to Smarty as a developer. I did used Smarty on templates before a bit here and there. But now I was assigned with a task to upgrade an app. I decided I will keep using Smarty. The app is using Smarty 2 and of course the first thing I did was upgrade it to the latest 3 version. This works fine while running under the latest PHP 5 branch

But once I switch the application to PHP 7, I just get blank pages. This happens both with Smarty 2 or 3. I assume 2 is not compatible with PHP 7, reason why I want to upgrade and because its old. The problem is that since this seems to be an issue with Smarty I don't get any PHP errors at all. I checked the web server, I turned all errors displays on PHP to on, and even executing the file from the command line outputs nothing, no errors. Just a blank white screen with no output.

The reason seems to be that in the templates_c folder no files are compiled when setting PHP 7 on the server, but works when using 5. I know the PHP code is legacy and this is what I need to do, upgrade the PHP code, but I cannot do this without making Smarty work first in order to see the errors and start fixing it.

Is there a way to log what is happening with Smarty and why its failing without any log outputs? I would expect to see PHP errors logged but it seems this is not happening.
Back to top
View user's profile Send private message
df444
Smarty n00b


Joined: 21 Apr 2019
Posts: 2

PostPosted: Sun Apr 21, 2019 4:02 pm    Post subject: Reply with quote

It seems this is not smarty tapping into my output.

While Smarty does not write to the templates_c (I will check that issue later since its not a permission issue) at least I managed to show the PHP errors finally!!!

I imagined smarty was causing this but not. It seems the previous developer decided to suppress errors on the code and use error_reporting to 0 on a lot of files. That was the reason I was not getting any errors what so ever. Evil or Very Mad

Why in the world he was using 0 on a production code is beyond me, probably to hide the issues...

I assume if there is a smarty error in the future it would just display on the PHP error log as usual.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Apr 23, 2019 7:48 am    Post subject: Reply with quote

Do you use PHP-FPM or Apache module?
You can force error_reporting on SAPI level, but configuration is slightly different, depending on SAPI.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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