Search code examples
phpjoomla

My Joomla site shows PHP error: failed to open stream


I am working on a Joomla site, and just recently updated PHP to 7.2, but my site started throwing errors. I have also updated Joomla to the latest version, but errors still appear. I'm not good in PHP and don't know how to fix it.

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Color has a deprecated constructor in /public_html/templates/jf_social/features/color.php on line 11

Warning: require_once(/public_html/libraries/joomla/document/html/renderer/head.php): failed to open stream: No such file or directory in /public_html/templates/jf_social/error.php on line 52

Fatal error: require_once(): Failed opening required '/public_html/libraries/joomla/document/html/renderer/head.php' (include_path='.:/php:/opt/cpanel/ea-php73/root/usr/share/pear') in /public_html/templates/jf_social/error.php on line 52

I think error comes from my Joomla template, I am using this one https://www.joomforest.com/joomla/templates/jf-social

I can't receive support from that template developers, because my subscription is expired, and changing the template will take a lot of time for me, can you please anyone advise how to fix it?

Thank you very much!


Solution

  • Try to delete the line 52

    require_once(/public_html/libraries/joomla/document/html/renderer/head.php)
    

    from the File

    /public_html/templates/jf_social/error.php
    

    The renderer/head.php doesnt be supported any more in your joomla version. If there are no more errors, everything is fine, if not your template is not supported any more.

    Then go to the file

    /public_html/templates/jf_social/features/color.php
    

    and edit the line

    function Color($hex){
    

    to

    function __construct($hex){