1
votes

I have 2 days with an error 500 on my Joomla 3x Site (www.magic.cr)

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I found these on my error logs:

[23-Aug-2016 16:48:00 UTC] PHP Deprecated: Non-static method JApplication::redirect() should not be called statically, assuming $this from incompatible context in /home/kiwitex/public_html/magic.cr/templates/braink/error.php on line 9 [23-Aug-2016 16:48:00 UTC] PHP Notice: Undefined property: JDocumentError::$_messageQueue in /home/kiwitex/public_html/magic.cr/libraries/legacy/application/application.php on line 376 [23-Aug-2016 16:48:00 UTC] PHP Notice: Undefined property: JDocumentError::$client in /home/kiwitex/public_html/magic.cr/libraries/legacy/application/application.php on line 394 [23-Aug-2016 16:48:00 UTC] PHP Notice: Trying to get property of non-object in /home/kiwitex/public_html/magic.cr/libraries/legacy/application/application.php on line 394 [23-Aug-2016 16:48:00 UTC] PHP Fatal error: Call to undefined method JDocumentError::close() in /home/kiwitex/public_html/magic.cr/libraries/legacy/application/application.php on line 409

This is: public_html/magic.cr/templates/braink/error.php

<?php
defined('_JEXEC') or die;
if (!isset($this->error)) {
	$this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
	$this->debug = false; 
}else{
	switch($this->error->getCode()) {
		case "404":
			JApplication::redirect("index.php/404-error"); // replace the redirect URL with your own
			break;
		case "403":
			JApplication::redirect("index.php/404-error"); // replace the redirect URL with your own
			break;
	}
}  

I can access the administrator: www.magic.cr/administrator

Joomla 3.6.2 PHP Version 5.6.23

Thanks in advance!!

1

1 Answers

1
votes

The notice messages are issued because of incorrect usage of the static functions.

Here is the right way to call redirect function.

$app = JFactory::getApplication();
$app->redirect(url);