[英]Joomla 3.8 with PHP 7problems
我目前正在為我的網站強制從 PHP 5.6 過渡到 7.1(或 7.2,兩者都是一個選項)。 我有兩個網站,一個工作正常,但另一個沒有在 7.1 或 .2 上運行。
我收到以下錯誤消息:
[Thu Oct 25 09:25:21.985120 2018] [:error] [pid 12006] PHP Deprecated: Non-static method Joomla\\CMS\\Application\\CMSApplication::getMenu() should not be called statically, assuming $this from incompatible context in /home/public/sites/www.modderaandebanden.nl/libraries/src/Application/SiteApplication.php on line 275
[Thu Oct 25 09:25:21.985130 2018] [:error] [pid 12006] PHP Strict Standards: Only variables should be assigned by reference in /home/public/sites/www.modderaandebanden.nl/templates/siteground-j16-1/templates.php on line 15
我在所有頁面上都遇到了問題(它到處使用相同的模板)。 這是我打開當前使用的 Siteground J16-1 模板的 templates.php 時得到的:
<?if( $sg == 'banner' ):?>
<?php if (JRequest::getVar('view') == 'frontpage'):?>
<!-- SIDE BEGIN --><!-- SIDE END -->
<?php endif?>
<?else:?>
<?php echo $app->getCfg('sitename'); ?>, Powered by <a href="http://joomla.org/" class="sgfooter" target="_blank">Joomla!</a>
<?php $menu = &JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) :?>
<!-- FOOTER BEGIN --><a href="http://www.siteground.com/cpanel-hosting.htm" target="_blank">Hosting with cPanel by SiteGround</a><!-- FOOTER END -->
<?php endif ?>
<?endif;?>
請讓我知道這是否可以澄清問題。 請原諒我的無禮... :-D
www.modderaandebanden.nl 是我的網站。
誰能告訴我這里發生了什么。 它是不適合與 PHP 7 一起使用的模板嗎?
提前致謝
這是警告和通知。 這不是錯誤!
通常您可以隱藏它:Joomla 配置 > 服務器選項卡 > 錯誤報告 -- 將其設置為最小值或無。
您也可以在服務器 php.ini 配置文件中修改此設置,或在網站根文件夾中的 php.ini 文件中進行設置(僅在某些服務器上可用)。
但最后您應該修復您的代碼以使用新的 Joomla 框架方法。 例如要獲取菜單,請使用:
// Get Joomla! instance
$jAp = JFactory::getApplication();
// Get variables
$menu = $jAp->getMenu();
看看這個獲取變量: https : //docs.joomla.org/Retrieving_request_data_using_JInput
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.