Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24
php 5.3.10-joomla – unethost無限空間虛擬主機 技術分享部落格

php 5.3.10-joomla

2012年4月初,我們開始陸續升級主機上的php版本。舊版的php 5.2.17已經是deprecated了。在接連得知有客戶的網站因為php 5.2的bug問題,被駭客攻擊之後,我們決定還是要忍痛升級php 5.3.10

升級php這件事,我相信對各家的主機商都是大工程。主要也是相容性的問題。如果升級一台shared host的php,老客戶的程式出現問題,我們還是得幫忙處理。

果然,我們一升級之後,客戶的joomla程式就出現了問題:本來沒有狀況的網頁,冒出了 Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in  …的字樣。

後來我們終於找到了問題,php 5.3對於語法嚴謹度的要求,比5.2還來得高。所以在 joomla的 modMainMenuHelper::buildXML() 這個函數,如果參數1傳入時,並不是用reference的型態傳入,就會造成問題。

解法是這樣子:
在檔案 /modules/mod_mainmenu/helper.php 中

修改一行,把&去掉
function buildXML(&$params)
改成
function buildXML($params)

這樣就搞定了。