0

I'm helping a client with getting their website ready for PHP8. After doing the update to the latest Joomla and making sure the template is updated, it runs fine on PHP8. I do however get the following error only on one page. The page where you have to create a new user:

Error: Failed opening required 
'/usr/www/users/kznden/libraries/joomla/document/html/renderer/head.php' (include_path='.:/usr/share/php'): Cannot access offset of type string on string

I know this path doesnt exist anymore but how can I get rid of this error and the page working again? I opened the error.php file and believe the error is related to that file. If I'm wrong, please correct me. Specifically the following code:

$doc->setTitle($this->error->getCode() . ' - '.$this->title);
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
$header_renderer = new JDocumentRendererHead($doc);
$header_contents = $header_renderer->render(null);

Removing

require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');

doesn't seem to fix the issue.

enter image description here

9
  • Can you post a screenshot of the error, does Joomla have any error logs available? Commented Oct 12, 2022 at 12:19
  • What have you tried to resolve the problem properly? Which of these lines causes the error? Commented Oct 12, 2022 at 12:26
  • This error is not thrown in your provided code. Commented Oct 12, 2022 at 12:27
  • Does this answer your question? PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string Commented Oct 12, 2022 at 12:27
  • Not sure of the image link shows. I cant yet add an image. Guess I'm too much of a new user yet. But basically the first piece of code in my post is what opens on the page. If I then edit any of the code it doesn't make a difference. I'm really at a loss. On PHP7.4 it works but as soon as I switch to PHP8 it gives the error. Commented Oct 12, 2022 at 15:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.