Ninjakreborn Posted May 9, 2017 Share Posted May 9, 2017 A client of mine finished up a new website for himself and needed some assistance taking it live. At first I thought it would be a standard site move. It didn't work out. I moved the files and database over and setup the URL's and everything. Then when I took it live I got the dreaded 500 server error. I spent some time debugging and checked the error log and ran into these errors: [08-May-2017 22:46:21 UTC] PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /home/###/public_html/wp-content/themes/zerif-lite/inc/jetpack.php on line 1 [08-May-2017 22:46:27 UTC] PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /home/###/public_html/wp-content/themes/zerif-lite/inc/jetpack.php on line 1 I removed the duplicates. I did a lot of digging regarding this issue and so far everything I've tried came up empty. If anyone has any advice or feedback I'd appreciate it. It's using PHP Version 5.4.45. If you need any further information, let me know. Link to comment Share on other sites More sharing options...
mac_gyver Posted May 9, 2017 Share Posted May 9, 2017 a) what are the actual first few lines of code in the file? is there actually a function definition stared on line 1? b) are you sure of the php version, by checking what the output from a phpinfo(); statement states it is? Link to comment Share on other sites More sharing options...
Ninjakreborn Posted May 9, 2017 Author Share Posted May 9, 2017 a) what are the actual first few lines of code in the file? is there actually a function definition stared on line 1? b) are you sure of the php version, by checking what the output from a phpinfo(); statement states it is? A: Code is as follows: <?php/** * Jetpack Compatibility File * Add theme support for Infinite Scroll. * See: http://jetpack.me/support/infinite-scroll/ */function zerif_jetpack_setup() { add_theme_support( 'infinite-scroll', array( 'container' => 'main', 'footer' => 'page', ) );}add_action( 'after_setup_theme', 'zerif_jetpack_setup' ); ?> I also tried reformatting and redownloading the latest copy of the file. Same issue. B) Yes, that was off PHP Info. At the top: PHP Version 5.4.45 -- Thanks! Link to comment Share on other sites More sharing options...
mac_gyver Posted May 9, 2017 Share Posted May 9, 2017 you need some white-space after any opening <?php tag. add a space, tab, or new-line. if a php tag is the first line in a file, i recommend always putting it as the only thing on the line, so that any errors can be pinned down to something before or after the tag. Link to comment Share on other sites More sharing options...
Ninjakreborn Posted May 9, 2017 Author Share Posted May 9, 2017 You, my friend, are a saint. I tried that when I first started (reformatted the file). I didn't think about that. Thanks, that worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.