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 不相容”

站內搜尋



本站其他服務

本站其他軟體



  • 台灣匯率快算

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


  • 臉書粉絲專頁搜尋 (FPSearch)

    不用登入臉書即可搜尋臉書粉絲專頁(臉書粉絲團)所公開的文章。您可以指定特定日期範圍之前的文章,也可設定搜尋粉絲專頁內包含特定關鍵詞的文章。


  • 標案快訊

    讓你可以輕鬆追蹤含有您想要關注關鍵詞的任何採購標案,只要有最新的資訊,「標案快訊」即會推播通知給你.


  • 下一班公車(nextBus)

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


  • 台灣空污警報(AirInfo)

    設定特定站點為推播通知關注點後,當該站點空氣品質變糟時,即時推播通知給您。另外提供站點附近基本天氣預測資料。


  • 照片去背(PhotoEraser)

    一款方便移除背景的工具,產生透明背景圖可以存回原本相簿,也可分享到其他 App 使用.