Parse error: syntax error, unexpected end of file in /home/ubuntu/workspace/wordpress/wp-content/themes/[theme-name]/header.php on line 248
I got this error today while working on creating a staging site. The site had WordPress installed in a subfolder, and this had already caused a whole slough of problems that I had spent most of my morning working on and slowly annihilating, but this problem was unrelated to that.
Here’s the solution that I found on the WordPress forms: the issue was caused by php syntax that worked on the production server where the site was built for some reason, but wasn’t working on the staging server where I was trying to set up the development sandbox. There was an opening php tag toward the end of the theme’s header.php that was incorrect (see the image). I changed it to
<?php and the error went away and the site loaded.
Hope that helps! If you have any questions or thoughts to add please leave them in the comments.