RuntimeException
Failed to write cache file "/nas/content/live/gfguide/wp-content/cache/gantry5/TMSC/twig/6d/6d01e562facd34c6c358dec6635f7228cbf4cba1011a83cc2fe36779212ca058.php". RuntimeException thrown with message "Failed to write cache file "/nas/content/live/gfguide/wp-content/cache/gantry5/TMSC/twig/6d/6d01e562facd34c6c358dec6635f7228cbf4cba1011a83cc2fe36779212ca058.php"." Stacktrace: #13 RuntimeException in /nas/content/live/gfguide/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Cache/FilesystemCache.php:80 #12 Twig\Cache\FilesystemCache:write in /nas/content/live/gfguide/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:487 #11 Twig\Environment:loadClass in /nas/content/live/gfguide/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:445 #10 Twig\Environment:loadTemplate in /nas/content/live/gfguide/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:423 #9 Twig\Environment:load in /nas/content/live/gfguide/wp-content/plugins/gantry5/vendor/timber/timber/lib/Loader.php:78 #8 Timber\Loader:render in /nas/content/live/gfguide/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:334 #7 Timber\Timber:compile in /nas/content/live/gfguide/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:383 #6 Timber\Timber:fetch in /nas/content/live/gfguide/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:410 #5 Timber\Timber:render in /nas/content/live/gfguide/wp-content/themes/g5_helium/comments.php:28 #4 require in /nas/content/live/gfguide/wp-includes/comment-template.php:1631 #3 comments_template in /nas/content/live/gfguide/wp-content/plugins/blog-designer-pro/bdp_templates/single/single.php:314 #2 include in /nas/content/live/gfguide/wp-includes/template-loader.php:106 #1 require_once in /nas/content/live/gfguide/wp-blog-header.php:19 #0 require in /nas/content/live/gfguide/index.php:17
Stack frames (14)
13
RuntimeException
/compat/vendor/twig/twig/src/Cache/FilesystemCache.php80
12
Twig\Cache\FilesystemCache write
/compat/vendor/twig/twig/src/Environment.php487
11
Twig\Environment loadClass
/compat/vendor/twig/twig/src/Environment.php445
10
Twig\Environment loadTemplate
/compat/vendor/twig/twig/src/Environment.php423
9
Twig\Environment load
/vendor/timber/timber/lib/Loader.php78
8
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
7
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
6
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
5
Timber\Timber render
/nas/content/live/gfguide/wp-content/themes/g5_helium/comments.php28
4
require
/nas/content/live/gfguide/wp-includes/comment-template.php1631
3
comments_template
/nas/content/live/gfguide/wp-content/plugins/blog-designer-pro/bdp_templates/single/single.php314
2
include
/nas/content/live/gfguide/wp-includes/template-loader.php106
1
require_once
/nas/content/live/gfguide/wp-blog-header.php19
0
require
/nas/content/live/gfguide/index.php17
            throw new \RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir));
        }
 
        $tmpFile = tempnam($dir, basename($key));
        if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) {
            @chmod($key, 0666 & ~umask());
 
            if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
                // Compile cached file into bytecode cache
                if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) {
                    @opcache_invalidate($key, true);
                } elseif (\function_exists('apc_compile_file')) {
                    apc_compile_file($key);
                }
            }
 
            return;
        }
 
        throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key));
    }
 
    public function getTimestamp($key)
    {
        if (!file_exists($key)) {
            return 0;
        }
 
        return (int) @filemtime($key);
    }
}
 
class_alias('Twig\Cache\FilesystemCache', 'Twig_Cache_Filesystem');
 
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $loader = $this->getLoader();
                if (!$loader instanceof SourceContextLoaderInterface) {
                    $source = new Source($loader->getSource($name), $name);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
    /**
     * Loads a template internal representation.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @param string $name  The template name
     * @param int    $index The index if it is an embedded template
     *
     * @return \Twig_TemplateInterface A template instance representing the given template name
     *
     * @throws LoaderError  When the template cannot be found
     * @throws RuntimeError When a previously generated cache is corrupted
     * @throws SyntaxError  When an error occurred during compilation
     *
     * @internal
     */
    public function loadTemplate($name, $index = null)
    {
        return $this->loadClass($this->getTemplateClass($name), $name, $index);
    }
 
    /**
     * @internal
     */
    public function loadClass($cls, $name, $index = null)
    {
        $mainCls = $cls;
        if (null !== $index) {
            $cls .= '___'.$index;
        }
 
        if (isset($this->loadedTemplates[$cls])) {
            return $this->loadedTemplates[$cls];
        }
 
        if (!class_exists($cls, false)) {
            if ($this->bcGetCacheFilename) {
                $key = $this->getCacheFilename($name);
            } else {
     *
     * @param string|TemplateWrapper|\Twig\Template $name The template name
     *
     * @throws LoaderError  When the template cannot be found
     * @throws RuntimeError When a previously generated cache is corrupted
     * @throws SyntaxError  When an error occurred during compilation
     *
     * @return TemplateWrapper
     */
    public function load($name)
    {
        if ($name instanceof TemplateWrapper) {
            return $name;
        }
 
        if ($name instanceof Template) {
            return new TemplateWrapper($this, $name);
        }
 
        return new TemplateWrapper($this, $this->loadTemplate($name));
    }
 
    /**
     * Loads a template internal representation.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @param string $name  The template name
     * @param int    $index The index if it is an embedded template
     *
     * @return \Twig_TemplateInterface A template instance representing the given template name
     *
     * @throws LoaderError  When the template cannot be found
     * @throws RuntimeError When a previously generated cache is corrupted
     * @throws SyntaxError  When an error occurred during compilation
     *
     * @internal
     */
    public function loadTemplate($name, $index = null)
        }
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
 */

defined('ABSPATH') or die;

use Timber\Timber;

/*
 * The template for displaying comments
 */

$context = Timber::get_context();

$post            = new \Timber\Post();
$context['post'] = $post;

if (post_password_required($post)) {
    return;
}

Timber::render(['partials/comments-' . $post->ID . '.html.twig', 'partials/comments-' . $post->post_type . '.html.twig', 'partials/comments.html.twig'], $context);
 
 
    if ( ! defined( 'COMMENTS_TEMPLATE' ) ) {
        define( 'COMMENTS_TEMPLATE', true );
    }
 
    $theme_template = trailingslashit( $wp_stylesheet_path ) . $file;
 
    /**
     * Filters the path to the theme template file used for the comments template.
     *
     * @since 1.5.1
     *
     * @param string $theme_template The path to the theme template file.
     */
    $include = apply_filters( 'comments_template', $theme_template );
 
    if ( file_exists( $include ) ) {
        require $include;
    } elseif ( file_exists( trailingslashit( $wp_template_path ) . $file ) ) {
        require trailingslashit( $wp_template_path ) . $file;
    } else { // Backward compat code will be removed in a future release.
        require ABSPATH . WPINC . '/theme-compat/comments.php';
    }
}
 
/**
 * Displays the link to the comments for the current post ID.
 *
 * @since 0.71
 *
 * @param false|string $zero      Optional. String to display when no comments. Default false.
 * @param false|string $one       Optional. String to display when only one comment is available. Default false.
 * @param false|string $more      Optional. String to display when there are more than one comment. Default false.
 * @param string       $css_class Optional. CSS class to use for comments. Default empty.
 * @param false|string $none      Optional. String to display when comments have been turned off. Default false.
 */
function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
    $post_id         = get_the_ID();
    $post_title      = get_the_title();
    $comments_number = (int) get_comments_number( $post_id );
                                }
                            }
                            $my_query = new wp_query( $args );
                            if ( $my_query->have_posts() ) {
                                ?>
                                <div class="related_post_wrap">
                                    <?php
                                    do_action( 'bdp_related_post_detail', $bdp_theme, $post_perpage, $related_post_by, $title, $orderby, $order, $related_post_content_length, $related_post_content_from, $bdp_settings );
                                    ?>
                                </div>
                                <?php
                            }
                        }
                        if(isset($bdads_to_show_after) && 'relatet_post' === $bdads_to_show_after) {
                            do_action('bd_single_ads_display',$bdp_settings);
                        }
                        // If comments are open or we have at least one comment, load up the comment template.
                        if ( isset( $bdp_settings['display_comment'] ) && 1 == $bdp_settings['display_comment'] ) { //phpcs:ignore
                            if ( comments_open() || get_comments_number() ) {
                                comments_template();
                            }
                        }
                        if ( isset( $bdp_settings['display_related_post'] ) && 1 == $bdp_settings['display_related_post'] && 'bottom' !== $bdp_display_related_post ) { //phpcs:ignore
                            echo '</div>';
                        }
                        if ( isset( $bdp_settings['display_related_post'] ) && 1 == $bdp_settings['display_related_post'] && 'bottom' !== $bdp_display_related_post ) { //phpcs:ignore
                            $related_post_content_from   = isset( $bdp_settings['related_post_content_from'] ) ? $bdp_settings['related_post_content_from'] : '';
                            $related_post_content_length = isset( $bdp_settings['related_post_content_length'] ) ? $bdp_settings['related_post_content_length'] : '';
                            $args                        = array();
                            $orderby                     = 'date'; //phpcs:ignore
                            $order                       = 'DESC'; //phpcs:ignore
                            if ( isset( $bdp_settings['bdp_related_post_order_by'] ) && '' != $bdp_settings['bdp_related_post_order_by'] ) { //phpcs:ignore
                                $orderby = $bdp_settings['bdp_related_post_order_by']; //phpcs:ignore
                            }
                            if ( isset( $bdp_settings['bdp_related_post_order'] ) ) {
                                $order = $bdp_settings['bdp_related_post_order']; //phpcs:ignore
                            }
                            if ( 'category' === $related_post_by ) {
                                global $post;
                                $categories = get_the_category( $post->ID );
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx
REQUEST_URI /2014/08/lawrences-story/
USER fpm200017
HOME /home/fpm200017
HTTP_CF_CONNECTING_IP 85.208.98.31, 85.208.98.31
HTTP_USER_AGENT Mozilla/5.0 (compatible; SemrushBot-BA; +http://www.semrush.com/bot.html)
PHP_ADMIN_VALUE sendmail_path=/bin/sendmail-wrapper.sh 9c6b06b5c198384abe6191dea6663a37b89f8472 /usr/sbin/sendmail -t -i; syslog.ident=phperr-gfguide; newrelic.appname=gfguide; newrelic.browser_monitoring.auto_instrument=off; newrelic.enabled=off; newrelic.license=;
REDIRECT_STATUS 200
HTTPS on
HTTP_RAWHOST www.goodfuneralguide.co.uk
HTTP_X_WPENGINE_PHP_VERSION 8.4
PHP_VALUE upload_max_filesize=50M; post_max_size=100M;
SERVER_PORT 80
HTTP_ACCEPT_ENCODING gzip
HTTP_HOST www.goodfuneralguide.co.uk
REMOTE_ADDR 85.208.98.31
QUERY_STRING
HTTP_X_FORWARDED_HOST www.goodfuneralguide.co.uk
HTTP_X_WPE_SSL 1
HTTP_X_FORWARDED_PROTO https
PATH_TRANSLATED /nas/content/live/gfguide/index.php
SERVER_ADDR 127.0.0.1
HTTP_VIA 1.1 pod-402161 (Varnish/7.7)
HTTP_X_REAL_IP_REMOTE 85.208.98.31
HTTP_X_WPE_LOCAL_SSL 1
DOCUMENT_URI /index.php
PATH_INFO
SCRIPT_NAME /index.php
SCRIPT_FILENAME /nas/content/live/gfguide/index.php
IS_WPE 1
HTTP_X_IS_BOT 1
HTTP_X_WPE_INSTALL_NAME gfguide
HTTP_WPE_READONLY on
SERVER_PROTOCOL HTTP/1.1
CONTENT_LENGTH 0
REQUEST_SCHEME http
HTTP_X_UA_ORIGINAL Mozilla/5.0 (compatible; SemrushBot-BA; +http://www.semrush.com/bot.html)
SERVER_NAME www.goodfuneralguide.co.uk
DOCUMENT_ROOT /nas/content/live/gfguide
REQUEST_METHOD GET
REMOTE_PORT
HTTP_X_CACHE_GROUP normal
HTTP_X_WORDPRESS_TYPE DEFAULT
HTTP_X_WPE_REQUEST_ID d950ca7fff9324722a4cd0ac2d37bf1e
SYSLOG_IDENT phperr-gfguide
CONTENT_TYPE
GATEWAY_INTERFACE CGI/1.1
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1770416546.83
REQUEST_TIME 1770416546
Key Value
USER fpm200017
HOME /home/fpm200017
HTTP_CF_CONNECTING_IP 85.208.98.31, 85.208.98.31
HTTP_USER_AGENT Mozilla/5.0 (compatible; SemrushBot-BA; +http://www.semrush.com/bot.html)
PHP_ADMIN_VALUE sendmail_path=/bin/sendmail-wrapper.sh 9c6b06b5c198384abe6191dea6663a37b89f8472 /usr/sbin/sendmail -t -i; syslog.ident=phperr-gfguide; newrelic.appname=gfguide; newrelic.browser_monitoring.auto_instrument=off; newrelic.enabled=off; newrelic.license=;
REQUEST_URI /2014/08/lawrences-story/
REDIRECT_STATUS 200
HTTPS on
HTTP_RAWHOST www.goodfuneralguide.co.uk
HTTP_X_WPENGINE_PHP_VERSION 8.4
PHP_VALUE upload_max_filesize=50M; post_max_size=100M;
SERVER_PORT 80
HTTP_ACCEPT_ENCODING gzip
HTTP_HOST www.goodfuneralguide.co.uk
REMOTE_ADDR 85.208.98.31
QUERY_STRING
SERVER_SOFTWARE nginx
HTTP_X_FORWARDED_HOST www.goodfuneralguide.co.uk
HTTP_X_WPE_SSL 1
HTTP_X_FORWARDED_PROTO https
PATH_TRANSLATED /nas/content/live/gfguide/index.php
SERVER_ADDR 127.0.0.1
HTTP_VIA 1.1 pod-402161 (Varnish/7.7)
HTTP_X_REAL_IP_REMOTE 85.208.98.31
HTTP_X_WPE_LOCAL_SSL 1
DOCUMENT_URI /index.php
PATH_INFO
SCRIPT_NAME /index.php
SCRIPT_FILENAME /nas/content/live/gfguide/index.php
IS_WPE 1
HTTP_X_IS_BOT 1
HTTP_X_WPE_INSTALL_NAME gfguide
HTTP_WPE_READONLY on
SERVER_PROTOCOL HTTP/1.1
CONTENT_LENGTH 0
REQUEST_SCHEME http
HTTP_X_UA_ORIGINAL Mozilla/5.0 (compatible; SemrushBot-BA; +http://www.semrush.com/bot.html)
SERVER_NAME www.goodfuneralguide.co.uk
DOCUMENT_ROOT /nas/content/live/gfguide
REQUEST_METHOD GET
REMOTE_PORT
HTTP_X_CACHE_GROUP normal
HTTP_X_WORDPRESS_TYPE DEFAULT
HTTP_X_WPE_REQUEST_ID d950ca7fff9324722a4cd0ac2d37bf1e
SYSLOG_IDENT phperr-gfguide
CONTENT_TYPE
GATEWAY_INTERFACE CGI/1.1
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1770416546.83
REQUEST_TIME 1770416546
0. Whoops\Handler\PrettyPageHandler