Post by motion2082 » Tue Aug 07, 2018 8:35 am

Hey guys,

Running Opencart 3.0.2.0 successfully on PHP5.6 with no errors

As soon as I upgrade PHP to PHP7.0 I get the following constant error in my logs

Code: Select all

PHP Warning:  Division by zero in /home/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 82
Anyone know if this is going to cause issues placing orders?

Regards,
Motion

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Tue Aug 07, 2018 7:01 pm

Cache issues. After upgrading to at least PHP v7.1 release, ensure to run these steps: viewtopic.php?f=176&p=731004#p718325 . Not an OC bug.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Tue Aug 07, 2018 7:25 pm

straightlight wrote:
Tue Aug 07, 2018 7:01 pm
Cache issues. After upgrading to at least PHP v7.1 release, ensure to run these steps: viewtopic.php?f=176&p=731004#p718325 . Not an OC bug.
Hi Straightlight,

Tried all those steps but the issue still remains

- admin - > dashboard - > blue icon on the right
- admin - > extensions - > modifications - > refresh button

Is there a way to manually purge cache in OC3?

Regards,
Motion

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Tue Aug 07, 2018 7:38 pm

Is your system/storage folder inside or outside your OC environment?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Tue Aug 07, 2018 7:59 pm

straightlight wrote:
Tue Aug 07, 2018 7:38 pm
Is your system/storage folder inside or outside your OC environment?
I think inside, screenshot
https://imgur.com/a/c31OJES

config file public_html

Code: Select all

// DIR
define('DIR_APPLICATION', '/home/sc/public_html/catalog/');
define('DIR_SYSTEM', '/home/sc/public_html/system/');
define('DIR_IMAGE', '/home/sc/public_html/image/');
define('DIR_STORAGE', '/home/sc/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
config file admin folder

Code: Select all

// DIR
define('DIR_APPLICATION', '/home/sc/public_html/admin/');
define('DIR_SYSTEM', '/home/sc/public_html/system/');
define('DIR_IMAGE', '/home/sc/public_html/image/');
define('DIR_STORAGE', '/home/sc/storage/');
define('DIR_CATALOG', '/home/sc/public_html/catalog/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/template/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Wed Aug 08, 2018 1:01 am

Your screenshot points to the system/storage of the inside environment while your config.php files direct to the storage folder outside the environment. Your config.php files have the right defined path. However, you must ensure the proper CHMOD permissions and recursively set for the storage folder on that location.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Wed Aug 08, 2018 8:26 am

straightlight wrote:
Wed Aug 08, 2018 1:01 am
Your screenshot points to the system/storage of the inside environment while your config.php files direct to the storage folder outside the environment. Your config.php files have the right defined path. However, you must ensure the proper CHMOD permissions and recursively set for the storage folder on that location.
Does that mean I should leave everything how it is currently but change the CHMOD for the storage/system folder?

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by motion2082 » Wed Aug 15, 2018 1:56 pm

straightlight wrote:
Wed Aug 08, 2018 1:01 am
Your screenshot points to the system/storage of the inside environment while your config.php files direct to the storage folder outside the environment. Your config.php files have the right defined path. However, you must ensure the proper CHMOD permissions and recursively set for the storage folder on that location.
Everything is set to CHMOD 755 (folders) and 644 (files) but error still persists

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by motion2082 » Wed Sep 12, 2018 8:56 am

Bump still have this error on
PHP Warning: Division by zero in /home/fridaysc/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 82

What's weird is Line 82 is not source code, it's a comment in the PHP file

Code: Select all

<?php

/*
 * This file is part of Twig.
 *
 * (c) 2009 Fabien Potencier
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Stores the Twig configuration.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class Twig_Environment
{
    const VERSION = '1.24.2-DEV';

    protected $charset;
    protected $loader;
    protected $debug;
    protected $autoReload;
    protected $cache;
    protected $lexer;
    protected $parser;
    protected $compiler;
    protected $baseTemplateClass;
    protected $extensions;
    protected $parsers;
    protected $visitors;
    protected $filters;
    protected $tests;
    protected $functions;
    protected $globals;
    protected $runtimeInitialized = false;
    protected $extensionInitialized = false;
    protected $loadedTemplates;
    protected $strictVariables;
    protected $unaryOperators;
    protected $binaryOperators;
    protected $templateClassPrefix = '__TwigTemplate_';
    protected $functionCallbacks = array();
    protected $filterCallbacks = array();
    protected $staging;

    private $originalCache;
    private $bcWriteCacheFile = false;
    private $bcGetCacheFilename = false;
    private $lastModifiedExtension = 0;

    /**
     * Constructor.
     *
     * Available options:
     *
     *  * debug: When set to true, it automatically set "auto_reload" to true as
     *           well (default to false).
     *
     *  * charset: The charset used by the templates (default to UTF-8).
     *
     *  * base_template_class: The base template class to use for generated
     *                         templates (default to Twig_Template).
     *
     *  * cache: An absolute path where to store the compiled templates,
     *           a Twig_Cache_Interface implementation,
     *           or false to disable compilation cache (default).
     *
     *  * auto_reload: Whether to reload the template if the original source changed.
     *                 If you don't provide the auto_reload option, it will be
     *                 determined automatically based on the debug value.
     *
     *  * strict_variables: Whether to ignore invalid variables in templates
     *                      (default to false).
     *
     *  * autoescape: Whether to enable auto-escaping (default to html):
     *                  * false: disable auto-escaping
     *                  * true: equivalent to html
     *                  * html, js: set the autoescaping to one of the supported strategies
     *                  * filename: set the autoescaping strategy based on the template filename extension
     *                  * PHP callback: a PHP callback that returns an escaping strategy based on the template filename <-----THIS IS LINE 82????
     *
     *  * optimizations: A flag that indicates which optimizations to apply
     *                   (default to -1 which means that all optimizations are enabled;
     *                   set it to 0 to disable).
     *
     * @param Twig_LoaderInterface $loader  A Twig_LoaderInterface instance
     * @param array                $options An array of options
     */

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Wed Sep 12, 2018 8:27 pm

The file you are addressing is only the source of the reference where a specific TWIG file contains the definite problem. More information is needed. From which route location specifically are you encountering this error message?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Wed Sep 12, 2018 10:13 pm

straightlight wrote:
Wed Sep 12, 2018 8:27 pm
The file you are addressing is only the source of the reference where a specific TWIG file contains the definite problem. More information is needed. From which route location specifically are you encountering this error message?
The location of the error message is in the error.log

How do I find the route location if the error log points to /public_html/system/library/template/Twig/Environment.php

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Wed Sep 12, 2018 11:37 pm

How do I find the route location if the error log points to /public_html/system/library/template/Twig/Environment.php
By always focusing on the URL of the page you are visiting.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Thu Sep 13, 2018 7:25 am

straightlight wrote:
Wed Sep 12, 2018 11:37 pm
How do I find the route location if the error log points to /public_html/system/library/template/Twig/Environment.php
By always focusing on the URL of the page you are visiting.
There have been 60 Occurrences of this error since 2018-09-12 01:28:06

It Last appeared on: 2018-09-12 22:48:58

If I clear that error then in a 12 hour windows I will receive another 60 occurrences of it

It doesn't break the site and everything works fine but it's one of those things that I would prefer to clean up

Only happenned when I went from PHP5.6 to PHP7 on above

Regards,
Motion

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Thu Sep 13, 2018 7:41 pm

More information is needed. Using the default theme or custom theme?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Thu Sep 13, 2018 8:05 pm

straightlight wrote:
Thu Sep 13, 2018 7:41 pm
More information is needed. Using the default theme or custom theme?
Using the Journal 2 Theme

The only Twig thing that I can think that would be causing the issue is related to these mods
https://imgur.com/a/9omZT8f
in the new theme editor

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by straightlight » Thu Sep 13, 2018 8:44 pm

Revert back to the default theme and see if the issue can be reproduced.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by motion2082 » Thu Sep 13, 2018 9:02 pm

straightlight wrote:
Thu Sep 13, 2018 8:44 pm
Revert back to the default theme and see if the issue can be reproduced.
Only way I can do that is creating an DEV clone, guess that's the only option though now

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm

Post by motion2082 » Sat Sep 15, 2018 10:27 am

straightlight wrote:
Thu Sep 13, 2018 8:44 pm
Revert back to the default theme and see if the issue can be reproduced.
Doesn't happen on the default theme. Only the Journal Theme. So I guess we have narrowed down that something in Journal is causing it

Active Member

Posts

Joined
Tue May 12, 2015 8:48 pm
Who is online

Users browsing this forum: No registered users and 4 guests