Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable deprecated messages in Joomla?

I use Joomla v1.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.

like image 470
user975290 Avatar asked Oct 12 '11 20:10

user975290


2 Answers

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.

like image 162
Aurelio De Rosa Avatar answered Oct 24 '22 09:10

Aurelio De Rosa


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.

like image 5
ghbarratt Avatar answered Oct 24 '22 07:10

ghbarratt