0

I'm developing on a local server (my laptop, Windows 10, XAMPP, PHP v5.5.15)

The production server is Linux, PHP v5.6.14

Using the Jupiter 4 theme, I can add a DIV in the header as the last element in "mk-header-right" div, in header.php:

<div class="mk-header-right">

  <?php
    do_action('header_right_before');

    // to add elements using child themes

    //do_action('header_checkout');

    do_action('start_tour_link');

    do_action('header_social', 'header');

    do_action('header_search', 'header');

    do_action('header_copyright');

    do_action('header_right_after');

    // to add elements using child themes

?>
    <div class="contact-header"> //added this div
      <h2>XXX-XXX-XXXX<br>
      Miami-Florida</h2>
    </div>
  </div>

With the proper styling of a custom class contact-header in the themes/jupiter/stylesheet/css/styles.css it shows up just fine in my header.

Verifying that it works and causes no problems, I copy the header.php to the production server on HostGator, and I suddenly get a php error:

Parse error: syntax error, unexpected '$mk_options' (T_VARIABLE) in /home4/xxxxxx/public_html/wp-content/themes/jupiter/header.php on line 1

When I copy the backup of the original header.php back to wp-content/themes/jupiter on the production server, the website works again.

I've done this several times to confirm that it's this bit of html, the new div block added to header.php, that is causing the php error on the production server. But on my local development server, the code works.

TARKUS
  • 2,170
  • 5
  • 34
  • 52
  • You haven't properly checked the file *after* upload. If it says `line 1`, then it's about invalid linebreaks. – mario May 04 '16 at 23:25
  • The comment doesn't answer why the exact same website/database works on my development server, but not on the production host. Also, "You haven't properly checked the file after upload," why would the file be different? "This question was marked as an exact duplicate of an existing question." Well, the present question is obviously not even close to what has been posted as "an existing question." The "existing question" referenced isn't even a question, but a reference article. – TARKUS May 04 '16 at 23:41
  • Since you're a Windows user, you didn't upload it binary-safe per SSH, did you? I think it more likely you used FTP - unawarely of the transfer mode. -- Anyway, your question isn't answerable if there's no exact code representation. Syntax error questions are off-topic either way. – mario May 04 '16 at 23:46
  • I actually looked at that before posting the question. I used auto detect. Anyway, I closed FileZilla FTP, re-opened, re-uploaded, and now it works on the production server, same as on the development server. I guess it's not a code problem. – TARKUS May 04 '16 at 23:56

0 Answers0