php Joomla 网站抛出错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16122935/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Joomla website throwing errors
提问by Jahnavi K. Abhyuday
Sometime back, I had created a Joomla website on a third-party server. Now when I try to access the website, I'm seeing errors such as the following:
前段时间,我在第三方服务器上创建了一个 Joomla 网站。现在,当我尝试访问该网站时,我看到如下错误:
Strict Standards: Non-static method JLoader::import() should not be called statically in /home/chinfote/public_html/libraries/joomla/import.php on line 29
Strict Standards: Non-static method JLoader::register() should not be called statically in /home/chinfote/public_html/libraries/loader.php on line 71
Strict Standards: Non-static method JLoader::import() should not be called statically in /home/chinfote/public_html/libraries/joomla/import.php on line 32
Strict Standards: Non-static method JLoader::register() should not be called statically in /home/chinfote/public_html/libraries/loader.php on line 71
Strict Standards: Non-static method JLoader::load() should not be called statically in /home/chinfote/public_html/libraries/loader.php on line 161
Strict Standards: Non-static method JLoader::register() should not be called statically in /home/chinfote/public_html/libraries/loader.php on line 138
Strict Standards: Non-static method JRequest::clean() should not be called statically in /home/chinfote/public_html/libraries/joomla/import.php on line 33
Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/chinfote/public_html/libraries/joomla/environment/request.php on line 463
After searching on the net, I found that I should be making some changes in the php.ini file. But on the File Manager of the cpanel, I could not find this file. Could anyone please help me in finding this file and solving these errors. Or is there any other way to solve the above problem??
在网上搜索后,我发现我应该在php.ini文件中进行一些更改。但是在cpanel的文件管理器上,我找不到这个文件。任何人都可以帮我找到这个文件并解决这些错误。或者有没有其他办法可以解决上面的问题??
Many thanks in advance.
提前谢谢了。
~Jahnavi
〜贾纳维
回答by PUSTAKAKORAN.COM
Joomla 1.5 work in PHP 5.4.
Joomla 1.5 在 PHP 5.4 中工作。
You can paste this code index.phpfor frontend and backend. It works for me!
您可以为前端和后端粘贴此代码index.php。这个对我有用!
// Set flag that this is a parent file
// 设置标志这是父文件
define( '_JEXEC', 1 );
error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING );
回答by symcbean
Suppressing the warnings is not the same thing as fixing them.
抑制警告与修复它们不同。
Joomla might might have a lot of functionality built-in but it's security history is far from exemplory. Have you got the latest version of Joomla installed? If not, then do so now. If you are still getting warnings then report it as a bug.
Joomla 可能内置了很多功能,但它的安全历史远非示例性的。您是否安装了最新版本的 Joomla?如果没有,那么现在就这样做。如果您仍然收到警告,请将其报告为错误。
回答by utkarshk
I have encountered same issue, my configuration was Joomla 1.5 on shared hosting server.
我遇到了同样的问题,我的配置是共享托管服务器上的 Joomla 1.5。
However the hosting provider upgraded PHP Version to 5.4 from 5.2 . It seems that Joomla 1.5 is not compatible with PHP Version 5.4, so instead of supressing your errors (which of course is not a nice idea) try adjusting the PHP Version on your shared hosting/ or dedicated hosting...
然而,托管服务提供商将 PHP 版本从 5.2 升级到 5.4 。似乎 Joomla 1.5 与 PHP 5.4 版不兼容,因此与其抑制您的错误(这当然不是一个好主意),不如尝试在您的共享主机/或专用主机上调整 PHP 版本...
Cheers. If there is a warning do not hide it - resolve it...!!! :)
干杯。如果有警告不要隐藏它 - 解决它......!!!:)
回答by joe
unbelievable. you people are obviously not coders if all you are trying to do is to HIDE the message. Messages are there for a reason. find the function in your component and put the word static in front of it. function import( change to static function import(
逆天。如果您所做的只是隐藏消息,那么你们显然不是编码人员。消息存在是有原因的。在你的组件中找到这个函数,并在它前面加上 static 这个词。函数导入(改为静态函数导入(
Problem solved. not hidden
问题解决了。没有隐藏
回答by Anoop P S
Two things to address and surpass the errors 1. set error reporting to none in configuration 2. Your joomla version may be old ,
解决和超越错误的两件事 1. 在配置中将错误报告设置为无 2. 您的 joomla 版本可能很旧,
回答by Lucas Catani
You can paste this code index.php for administrator and frontend.
您可以为管理员和前端粘贴此代码 index.php。
// Set flag that this is a parent file
// 设置标志这是父文件
define( '_JEXEC', 1 );
error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING );
回答by Imane Fateh
You will find it in (for linux) /etc/php.ini
您会在(对于 linux)/etc/php.ini 中找到它
Try this: Replace display_errors = On --> display_errors = Off
试试这个:替换 display_errors = On --> display_errors = Off
error_reporting = E_ALL | E_STRICT --> error_reporting = E_ALL & ~E_NOTICE
error_reporting = E_ALL | E_STRICT --> error_reporting = E_ALL & ~E_NOTICE
回答by underscore
If there are no php.ini file in your joomla root directory make a new phi.ini file in using Cpanel ( create a new file ) and do you stuff with it
如果您的 joomla 根目录中没有 php.ini 文件,请使用 Cpanel 创建一个新的 phi.ini 文件(创建一个新文件)并使用它
回答by Ahm3d Said
Switch your php version to php 5.3
将您的 php 版本切换到 php 5.3
also change the error_reporting in your joomla configuration file (configuration.php)
还要更改 joomla 配置文件 (configuration.php) 中的 error_reporting
var $error_reporting = '6143';
回答by Bogdan
You can solve the problem only if you return to php 5.2 or you will change the new version to work with J 1.5
只能返回php 5.2才能解决问题,否则换新版本使用J 1.5