How to disable deprecated messages in Joomla?
I use Joomla v1开发者_StackOverflow社区.5, and after installing same components I got deprecated messages - how can I disable this messages in Joomla? I can't disable it in php.ini, because I don't have access for php in server.
Put in the index.php file, after this line define( '_JEXEC', 1 );
, this statement:
error_reporting(0);
or, as pderaaij says, use:
error_reporting(E_ALL ^ E_DEPRECATED);
As he says,
In this way all of the other errors are shown, except the deprecated messages.
The ideal solution is to set the global configuration setting called "Error Reporting" to either "None" or to "System Default" and then set the "system default" through the use of an .htaccess file on the web root or in the httpd/apache conf.
To set the value in the .htaccess file you can use:
php_value error_reporting 22527
(you can verify this value using php: echo E_ALL ^ E_DEPRECATED;
)
AurelioDeRosa's answer proposes to "hack" (!) the core of Joomla. As stated in my comment, placing error_reporting in multiple locations inside the code is bad practice as it should ideally only be set once. The Joomla 1.5 core code sets the error_reporting as appropriately configured in the global configuration.
I have added this at the begining of index.php and it fixed it:
ini_set('display_errors','Off');
error_reporting(E_ALL ^ E_DEPRECATED);
Thanks Aurelio De Rosa
I added the following in .htaccess file in joomla:
php_value allow_call_time_pass_reference 1
and it worked like a charm. Thanks
You can try add to index.php
ini_set('allow_call_time_pass_reference', 1);
or to .htaccess
php_value allow_call_time_pass_reference 1
But it depends what is causing the problem and also server configuration if you are allowed to change php configuration.
精彩评论