• Hi,
    I am getting ready to migrate my site to a new hosting service and looked at the error logs to see if I need to clean anything up first. Somehow, I hadn’t noticed this error log before about a PHP Fatal Error in the header.php files and it has been reported for a while. I first noticed it in my child theme and checked the main theme and it is there also. The following is the log from the main theme.

    
    [17-May-2017 06:02:34 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/index.php on line 14
    [07-Aug-2017 03:22:24 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/404.php on line 8
    [13-Aug-2017 12:23:46 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/archive.php on line 10
    [13-Aug-2017 12:23:46 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/404.php on line 8
    [13-Aug-2017 12:23:46 America/New_York] PHP Fatal error:  Call to undefined function language_attributes() in /...../wdcb/wp-content/themes/aaron/header.php on line 12
    [17-Aug-2017 10:30:09 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/index.php on line 14
    [15-Sep-2017 09:35:52 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/404.php on line 8
    [18-Sep-2017 22:24:23 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/404.php on line 8
    [19-Sep-2017 03:03:26 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/404.php on line 8
    [21-Sep-2017 06:20:08 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /...../wdcb/wp-content/themes/aaron/404.php on line 8
    

    The line is:

    <html <?php language_attributes(); ?>>
    

    Is this a problem with the PHP version I am using? Version 5.6.26.
    Would it be fixed if I go up to PHP Version 7.1 or would it still be a problem?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Carolina Nymark

    (@poena)

    Hi,
    thank you for reporting this.

    I am looking at my own logs where this theme is used, and the errors are not reported there.
    These are common, standard functions, so I am not sure how to troubleshoot it. It looks like the 404 is not loading correctly.

    Googling did not really help, all I found was that either:
    -The file is in the wrong directory, but this path looks correct /wp-content/themes/aaron/
    -The WordPress install or the latest WordPress update were not completed and related files were not copied correctly.

    Thread Starter sleeplessindc

    (@sleeplessindc)

    Hi,
    The WordPress version I’m using is 4.8.2 and it was updated using the Updates page in the Dashboard.

    I have also seen some error messages about the 404 header missing so it does seem that something thinks it is missing.

    I’ve seen a few times on other sites that a blank line before or after a PHP section will cause problems.

    I found information about the blank lines problem with PHP in the WordPress Codex for a solution to a different problem at https://codex.www.ads-software.com/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

    Because the error messages point to line 8, which is followed by a blank line, I tried the following experiment. I edited the 404.php file to take out the blank line following get_header(); ?> on line 8 and deleted the carriage return after <?php get_footer(); ?> at the bottom

    I uploaded the modified 404.php file to the aaron-child theme and worked through the pages on the site including some deliberate 404 errors. I checked in the aaron-child theme and this time there are no error messages.

    I did the same to the main aaron theme’s 404.php file and ran through the site’s pages again. No more error messages appear after October 1–the list I had included above–from the main aaron theme directory.

    I have no idea if my changes were the right thing to try but so far they seem to be working.

    Here is the full error log from May through October 1. Nothing new for today when I was going through the site after the edits.

    [17-May-2017 06:02:34 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/index.php on line 14
    [07-Aug-2017 03:22:24 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [13-Aug-2017 12:23:46 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/archive.php on line 10
    [13-Aug-2017 12:23:46 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [13-Aug-2017 12:23:46 America/New_York] PHP Fatal error:  Call to undefined function language_attributes() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/header.php on line 12
    [17-Aug-2017 10:30:09 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/index.php on line 14
    [15-Sep-2017 09:35:52 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [18-Sep-2017 22:24:23 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [19-Sep-2017 03:03:26 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [21-Sep-2017 06:20:08 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [22-Sep-2017 13:19:06 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [23-Sep-2017 03:34:23 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [23-Sep-2017 10:16:45 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    [26-Sep-2017 05:50:51 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/archive.php on line 10
    [26-Sep-2017 11:22:52 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/archive.php on line 10
    [27-Sep-2017 00:12:41 America/New_York] PHP Fatal error:  Call to undefined function language_attributes() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/header.php on line 12
    [27-Sep-2017 00:12:41 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/archive.php on line 10
    [30-Sep-2017 16:00:29 America/New_York] PHP Fatal error:  Call to undefined function language_attributes() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/header.php on line 12
    [01-Oct-2017 00:19:47 America/New_York] PHP Fatal error:  Call to undefined function get_header() in /home/stcwdc/public_html/wdcb/wp-content/themes/aaron/404.php on line 8
    

    Cheers,
    Cynthia

    Theme Author Carolina Nymark

    (@poena)

    Hi
    I appreciate if you continue to keep me updated so that we can see if this solved the issue or not ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Fatal Error’ is closed to new replies.