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 種以上貨幣即時換算,以及各種匯率歷史變化圖。


  • 下一台單車(NextBike)

    打開定位即搜尋附近二十點自行車站點,不塞滿全部站點資料到整個地圖上,所以畫面簡潔方便看清楚目前所在地,若需要搜尋地圖其他位置附近站點,再點擊地圖即可。


  • 照片去背(PhotoEraser)

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


  • 條碼掃描器(QRCode)

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


  • 國道一路通(FreeWay)

    打開定位即實際地圖上繪製所在地中心附近的車況圖,可縮放地圖,不再是小小的縮小圖,快速了解高速公路的路況。