警告:參數3至showBlogSection()預計是一個參考,在線路中/home/smartsta/public_html/includes/Cache/Lite/Function.php給定值100的Joomla PHP錯誤
我在突然間在我的Joomla網站的內容區域顯示上述錯誤,有什麼建議嗎?
更新:沒有這樣的運氣找到GoDaddy的FTP文件目錄,FTP或Joomal C-面板內訪問定義的文件和目錄。 在FTP中,我無法找到訪問此特定文件的內容來調查第100行。 在Joomla面板的全局配置中,我能夠將'錯誤信息'切換爲none,至少可以隱藏此錯誤。在緩存目錄中,我看不到進入該文件夾的任何選項,儘管它顯示。 我也看到了這個在c面板屏幕的底部,但只是鏈接到一個joomla幫助網站,並在字段內我沒有看到描述區域切換'打開或關閉' 「以下的PHP服務器設置不是最佳的安全和建議進行修改:中 PHP register_globals的設置爲ON
,而不是OFF
「
UPDATE2!:
我發現有問題的文件,下面是代碼。第100行僅表示:
global $$ object_123456789;
應用程序/ X的httpd - PHP Function.php PHP腳本文本
<?php
/**
* This class extends Cache_Lite and can be used to cache the result and output of functions/methods
*
* This class is completly inspired from Sebastian Bergmann's
* PEAR/Cache_Function class. This is only an adaptation to
* Cache_Lite
*
* There are some examples in the 'docs/examples' file
* Technical choices are described in the 'docs/technical' file
*
* @package Cache_Lite
* @version $Id: Function.php 47 2005-09-15 02:55:27Z rhuk $
* @author Sebastian BERGMANN <[email protected]>
* @author Fabien MARTY <[email protected]>
*/
// no direct access
defined('_VALID_MOS') or die('Restricted access');
require_once($mosConfig_absolute_path . '/includes/Cache/Lite.php');
class Cache_Lite_Function extends Cache_Lite
{
// --- Private properties ---
/**
* Default cache group for function caching
*
* @var string $_defaultGroup
*/
var $_defaultGroup = 'Cache_Lite_Function';
// --- Public methods ----
/**
* Constructor
*
* $options is an assoc. To have a look at availables options,
* see the constructor of the Cache_Lite class in 'Cache_Lite.php'
*
* Comparing to Cache_Lite constructor, there is another option :
* $options = array(
* (...) see Cache_Lite constructor
* 'defaultGroup' => default cache group for function caching (string)
*);
*
* @param array $options options
* @access public
*/
function Cache_Lite_Function($options = array(NULL))
{
if (isset($options['defaultGroup'])) {
$this->_defaultGroup = $options['defaultGroup'];
}
$this->Cache_Lite($options);
}
/**
* Calls a cacheable function or method (or not if there is already a cache for it)
*
* Arguments of this method are read with func_get_args. So it doesn't appear
* in the function definition. Synopsis :
* call('functionName', $arg1, $arg2, ...)
* (arg1, arg2... are arguments of 'functionName')
*
* @return mixed result of the function/method
* @access public
*/
function call()
{
$arguments = func_get_args();
$id = serialize($arguments); // Generate a cache id
if (!$this->_fileNameProtection) {
$id = md5($id);
// if fileNameProtection is set to false, then the id has to be hashed
// because it's a very bad file name in most cases
}
$data = $this->get($id, $this->_defaultGroup);
if ($data !== false) {
$array = unserialize($data);
$output = $array['output'];
$result = $array['result'];
} else {
ob_start();
ob_implicit_flush(false);
$target = array_shift($arguments);
if (strstr($target, '::')) { // classname::staticMethod
list($class, $method) = explode('::', $target);
$result = call_user_func_array(array($class, $method), $arguments);
} else if (strstr($target, '->')) { // object->method
// use a stupid name ($objet_123456789 because) of problems when the object
// name is the same as this var name
list($object_123456789, $method) = explode('->', $target);
global $$object_123456789;
$result = call_user_func_array(array($$object_123456789, $method), $arguments);
} else { // function
$result = call_user_func_array($target, $arguments);
}
$output = ob_get_contents();
ob_end_clean();
$array['output'] = $output;
$array['result'] = $result;
$this->save(serialize($array), $id, $this->_defaultGroup);
}
echo($output);
return $result;
}
}
?>
當您查看100行上的/home/smartsta/public_html/includes/Cache/Lite/Function.php時,您在那看到了什麼?你應該記錄錯誤而不是顯示它們,所以它們不會出現在頁面中。 – hakre 2012-03-11 15:31:21
我還沒有檢出文件,但在這個'突然出錯'之前,代碼中沒有任何錯誤。是否有可能出現在線路100上?我該如何記錄錯誤,使它們不會出現在頁面中? – 2012-03-11 15:42:18
感謝您的迴應! – 2012-03-11 15:43:04