Joomla 1.5.14 和 PHP 5.3.2 不相容

2010/04/12
~ 阿亮 ~

今天追一個 Joomla 的問題,和 PHP 升級到 5.3 造成不相容有關。

結論:系統 Package (比如 PHP 5.2.X–> PHP 5.3.X) 不要亂升級,很容易出事!要很花時間去追問題。

特徵是「選單」會全部不見!在 httpd-error.log 會有類似下列的錯誤訊息。

PHP Warning:  Parameter 4 to JHTMLMenu::treerecurse() expected to be a reference, value given in \
        {Joomla}/libraries/joomla/html/html.php on line 87, referer: \
        http://{Joomla_site}//administrator/index.php?option=com_menus&task=view&menutype=mainmenu2
PHP Warning:  array_slice() expects parameter 1 to be array, null given in \
        {Joomla}/administrator/components/com_menus/models/list.php on line 143, referer: \
        http://{Joomla_site}//administrator/index.php?option=com_menus&task=view&menutype=mainmenu2
PHP Warning:  Invalid argument supplied for foreach() in \
        {Joomla}/administrator/components/com_menus/models/list.php on line 147, referer: \
        http://{Joomla_site}//administrator/index.php?option=com_menus&task=view&menutype=mainmenu2
PHP Warning:  Invalid argument supplied for foreach() in \
        {Joomla}/administrator/components/com_menus/views/list/view.php on line 65, referer: \
        http://{Joomla_site}//administrator/index.php?option=com_menus&task=view&menutype=mainmenu2
PHP Warning:  Invalid argument supplied for foreach() in \
        {Joomla}/administrator/components/com_menus/views/list/tmpl/default.php on line 69, referer: \
         http://{Joomla_site}//administrator/index.php?option=com_menus&task=view&menutype=mainmenu2

這個要修改 libraries/joomla/html/html.php 第 85 行的

if (is_callable( array( $className, $func ) ))
{
        $args = func_get_args();
        array_shift( $args );
        return call_user_func_array( array( $className, $func ), $args );
}
else

改成

if (is_callable( array( $className, $func ) ))
{
        $temp=func_get_args();
        array_shift( $temp );
        $args = array();
        foreach ($temp as $k => $v) {
                $args[] = &$temp[$k];
        }
        return call_user_func_array( array( $className, $func ), $args );
}
else

參考自此頁 

 

另外,httpd-error.log會有

PHP Warning:  Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value \
          given in {Joomla}/libraries/joomla/cache/handler/callback.php on line 99

這個修改 modules/mod_mainmenu/helper.php 第 31 行, 由

function buildXML(&$params)

改成

function buildXML($params)

參考自此頁 



2 Responses to “Joomla 1.5.14 和 PHP 5.3.2 不相容”

站內搜尋



本站其他服務

本站其他軟體



  • 下一班公車(nextBus)

    這個 app 只要開啟後,就根據定位幫你過濾出附近站牌的時刻表,以及提供相關公車預計到站的時間,方便您在很快時間內確定要坐的哪一班公車


  • 台灣匯率快算

    提供全球 150 種以上貨幣即時換算,以及各種匯率歷史變化圖。


  • 姓名筆畫吉凶查詢系統

    這是一個提供中文字康熙筆畫的小軟體,並根據農民曆計算每個名字或公司名的總筆畫以及最後的吉凶數,共有四種模式


  • 批踢踢快訊 (pttNews)

    身為鄉民的您,是不是常常覺得現在的批踢踢 (PTT) 閱讀器,明明您就只要看幾個板,都幫您分類好,但不是您要的?甚至您只想關注某個人(或某件事)的消息,卻散布在不同東西,找出來很辛苦? 這個 App 可以解決您這些問題,快來用吧!


  • 股海快訊 (iNews123)

    提供特定個股新聞更新推播、股價警示推播、新聞社群分享以及每日個股收盤價等功能的股票App/股市App.


  • 條碼掃描器(QRCode)

    支援 QRCode and Barcodes、可連續快速掃描、自動對焦、可打開手電筒供掃描時使用