Page 1 of 1

core.read_cache_file.php failed to open, errror

Posted: Fri Apr 02, 2010 10:24 am
by russia5
I am changing the names of some of my custom smarty files. The files worked before, but now I am getting this error and I can not explain it. Can someone tell me why I am getting it and how to fix it? I do have core,read_cache_file.php loaded in libs.

Code: Select all

Warning: require_once(/home/russia5/public_html/libs/smarty/internals/core.read_cache_file.php) [function.require-once]: failed to open stream: No such file or directory in /home/russia6/public_html/Software Projects/Apex Framework/libs/smarty/Smarty.class.php on line 1174

Fatal error: require_once() [function.require]: Failed opening required '/home/russia5/public_html/libs/smarty/internals/core.read_cache_file.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/russia6/php:/home/russia6/public_html/libs/pear/') in /home/russia6/public_html/Software Projects/Apex Framework/libs/smarty/Smarty.class.php on line 1174

I have reloaded Smarty.class.php and core.read_cache_file.php and I still get the same error. 



This is a copy of Smarty.class.php starting with line 1174

Code: Select all

require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
            if (smarty_core_read_cache_file($_params, $this)) {
                $_smarty_results = $_params['results'];
                if (!empty($this->_cache_info['insert_tags'])) {
                    $_params = array('plugins' => $this->_cache_info['insert_tags']);
                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
                    smarty_core_load_plugins($_params, $this);
                    $_params = array('results' => $_smarty_results);
                    require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
                    $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
                }
                if (!empty($this->_cache_info['cache_serials'])) {
                    $_params = array('results' => $_smarty_results);
                    require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
                    $_smarty_results = smarty_core_process_compiled_include($_params, $this);
                }


                if ($display) {
                    if ($this->debugging)
                    {
                        // capture time for debugging info
                        $_params = array();
                        require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
                        $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
                        require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
                        $_smarty_results .= smarty_core_display_debug_console($_params, $this);
                    }
                    if ($this->cache_modified_check) {
                        $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
                        $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
                        $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT';
                        if (@count($this->_cache_info['insert_tags']) == 0
                            && !$this->_cache_serials
                            && $_gmt_mtime == $_last_modified_date) {
                            if (php_sapi_name()=='cgi')
                                header('Status: 304 Not Modified');
                            else
                                header('HTTP/1.1 304 Not Modified');

                        } else {
                            header('Last-Modified: '.$_gmt_mtime);
                            echo $_smarty_results;
                        }
                    } else {
                            echo $_smarty_results;
                    }
                    error_reporting($_smarty_old_error_level);
                    // restore initial cache_info
                    $this->_cache_info = array_pop($_cache_info);
                    return true;
                } else {
                    error_reporting($_smarty_old_error_level);
                    // restore initial cache_info
                    $this->_cache_info = array_pop($_cache_info);
                    return $_smarty_results;
                }
            } else {
                $this->_cache_info['template'][$resource_name] = true;
                if ($this->cache_modified_check && $display) {
                    header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
                }
            }
        } 

Thank You for any help.

Re: core.read_cache_file.php failed to open, errror

Posted: Fri Apr 02, 2010 1:26 pm
by learnerabn
russia5 wrote:I am changing the names of some of my custom smarty files. The files worked before, but now I am getting this error and I can not explain it. Can someone tell me why I am getting it and how to fix it? I do have core,read_cache_file.php loaded in libs.

Code: Select all

Warning: require_once(/home/russia5/public_html/libs/smarty/internals/core.read_cache_file.php) [function.require-once]: failed to open stream: No such file or directory in /home/russia6/public_html/Software Projects/Apex Framework/libs/smarty/Smarty.class.php on line 1174

Fatal error: require_once() [function.require]: Failed opening required '/home/russia5/public_html/libs/smarty/internals/core.read_cache_file.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/russia6/php:/home/russia6/public_html/libs/pear/') in /home/russia6/public_html/Software Projects/Apex Framework/libs/smarty/Smarty.class.php on line 1174

I have reloaded Smarty.class.php and core.read_cache_file.php and I still get the same error. 



This is a copy of Smarty.class.php starting with line 1174

Code: Select all

require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
            if (smarty_core_read_cache_file($_params, $this)) {
                $_smarty_results = $_params['results'];
                if (!empty($this->_cache_info['insert_tags'])) {
                    $_params = array('plugins' => $this->_cache_info['insert_tags']);
                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
                    smarty_core_load_plugins($_params, $this);
                    $_params = array('results' => $_smarty_results);
                    require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
                    $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
                }
                if (!empty($this->_cache_info['cache_serials'])) {
                    $_params = array('results' => $_smarty_results);
                    require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
                    $_smarty_results = smarty_core_process_compiled_include($_params, $this);
                }


                if ($display) {
                    if ($this->debugging)
                    {
                        // capture time for debugging info
                        $_params = array();
                        require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
                        $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
                        require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
                        $_smarty_results .= smarty_core_display_debug_console($_params, $this);
                    }
                    if ($this->cache_modified_check) {
                        $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
                        $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
                        $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT';
                        if (@count($this->_cache_info['insert_tags']) == 0
                            && !$this->_cache_serials
                            && $_gmt_mtime == $_last_modified_date) {
                            if (php_sapi_name()=='cgi')
                                header('Status: 304 Not Modified');
                            else
                                header('HTTP/1.1 304 Not Modified');

                        } else {
                            header('Last-Modified: '.$_gmt_mtime);
                            echo $_smarty_results;
                        }
                    } else {
                            echo $_smarty_results;
                    }
                    error_reporting($_smarty_old_error_level);
                    // restore initial cache_info
                    $this->_cache_info = array_pop($_cache_info);
                    return true;
                } else {
                    error_reporting($_smarty_old_error_level);
                    // restore initial cache_info
                    $this->_cache_info = array_pop($_cache_info);
                    return $_smarty_results;
                }
            } else {
                $this->_cache_info['template'][$resource_name] = true;
                if ($this->cache_modified_check && $display) {
                    header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
                }
            }
        } 

Thank You for any help.
can i know whether the file name is core,read_cache_file.php or core.read_cache_file.php?
including include function in place of require once may avoid error msg.
but i cant trace why the error appears...

Re: core.read_cache_file.php failed to open, errror

Posted: Fri Apr 02, 2010 4:23 pm
by russia5
Thanks for the response. it probably helped me figure out the error. If you notice, one path from home has russia5 and the other has russia6, that is because I have two sites with different named directories. I went to my sites includes and set the home path to russia6 and it works.