PHP Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "str_replace" function
Hello there, I wasn't able to access to my site. When I go to my site I get an HTTP Error 500.
So I checked the error log and the hosting provider sent me this PHP log:
[28-Sep-2017 01:22:00 UTC] PHP Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "str_replace" function in "__string_template__93b379fc6cfd9119fb201c82c717cfe86213ebb5662052075dc9fb5cf451a1fd" at line 16.' in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php:574
Stack trace:
#0 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('str_replace', 16)
#1 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('str_replace', 16)
#2 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression()
#3 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary()
#4 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(91): Twig_ExpressionParser->parseExpression()
#5 /home/gloo/public_html/newgloo/system/lib in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php on line 574
Has anyone encountered this problem or is there any way on how to fix this? Thank you in advance!
So I checked the error log and the hosting provider sent me this PHP log:
[28-Sep-2017 01:22:00 UTC] PHP Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "str_replace" function in "__string_template__93b379fc6cfd9119fb201c82c717cfe86213ebb5662052075dc9fb5cf451a1fd" at line 16.' in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php:574
Stack trace:
#0 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('str_replace', 16)
#1 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('str_replace', 16)
#2 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression()
#3 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary()
#4 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(91): Twig_ExpressionParser->parseExpression()
#5 /home/gloo/public_html/newgloo/system/lib in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php on line 574
Has anyone encountered this problem or is there any way on how to fix this? Thank you in advance!
Are you using a fresh or upgrade version of Opencart v3.x and which version of Opencart are you using?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hello szewern97,
I have to same problem is occurs so please advice me how to solved this problem.
I have to same problem is occurs so please advice me how to solved this problem.
Hello, there so sorry for the late reply.. For my case, it seems like there is smth added in the theme table in my database, so after I've deleted it, the server is up again.. However, I'm not really sure if that is the cause, better to backup ur files before u delete it.. HAHA hope it helpsgautam.hsquare wrote: ↑Mon Oct 16, 2017 5:47 pmHello szewern97,
I have to same problem is occurs so please advice me how to solved this problem.
Hi,
I am getting the same error.
When I open frontend. I can view it normally. Perpetualmart.com
But when I try to open the admin panel
perpetualmart.com/admin after entering credentials, I am getting below stact trace
Fatal error: Uncaught Twig_Error_Syntax: Unknown "isset" function in "common/dashboard.twig" at line 17. in system/library/template/Twig/ExpressionParser.php:574 Stack trace: #0
system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('isset', 17) #1 system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('isset', 17) #2 system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression() #3 system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary() #4
system/library/template/Twig/TokenParser/If.php(31): Twig_ExpressionParser->parseExpression() #5
system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #6
system/library/template in system/library/template/Twig/ExpressionParser.php on line 574
I check the Theme table as suggested in one of comments. But There is no any entry in my theme table
I am getting the same error.
When I open frontend. I can view it normally. Perpetualmart.com
But when I try to open the admin panel
perpetualmart.com/admin after entering credentials, I am getting below stact trace
Fatal error: Uncaught Twig_Error_Syntax: Unknown "isset" function in "common/dashboard.twig" at line 17. in system/library/template/Twig/ExpressionParser.php:574 Stack trace: #0
system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('isset', 17) #1 system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('isset', 17) #2 system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression() #3 system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary() #4
system/library/template/Twig/TokenParser/If.php(31): Twig_ExpressionParser->parseExpression() #5
system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #6
system/library/template in system/library/template/Twig/ExpressionParser.php on line 574
I check the Theme table as suggested in one of comments. But There is no any entry in my theme table
First of all (!): which OpenCart version are you using?
Second: there is no "isset" in this template.
Because (third) isset does not exist in the twig syntax.
Second: there is no "isset" in this template.
Because (third) isset does not exist in the twig syntax.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
in short stop renaming .tpl files into .twig files and/or stop putting php in twig files.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Who is online
Users browsing this forum: No registered users and 547 guests