Jump to content

Server 500 error migrating WordPress sites


Go to solution Solved by mac_gyver,

Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites
  • Solution

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 post
Share on other sites
This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.