Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Website Format Issue After Server Migration

    I have been banging my head against a desk for a bit trying to figure this out. I have used firebug and have gone over the code and cannot figure out why after migrating a website to a different cpanel/whm server it displays differently.

    Here is new old site on the old server: pmiindustries.com

    The new site is at test.pmiindustries.com

    does anyone have any idea why it would display different both are running on a linux host. The versions of apache are different but php versions are the same, I am not sure what else would cause this.


    Thanks in advance

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Won't follow unknown links while I'm here at work.
    If you visually see a difference, this is a rendering issue, which may or may not be fixed in a PHP script, but relates directly to the output source.
    If the code is identical, and the physical servers have changed, my first guess would be the use of short tags is randomly scattered. Since PHP uses <? and ?>, if short tags are not enabled (they are enabled by default), then HTML will render <? . . . ?> as an output element in your HTML source which will often break the visual layout. Short echo prior to 5.4 is also affected by this directive, so if you have <?= then it will not echo with short tags disabled (unless you are on 5.4+).

    So take a look through the HTML source and do a search for <?. Does it have any matches popping up? If so, then either convert those to use <?php (<?= would be <?php echo), or enable the short_open_tags directive in the php.ini or .htaccess.

    If you are not moving physical servers (seeing subdomains here), then I'd put my money on a broken CSS link.

  • #3
    Regular Coder
    Join Date
    Nov 2012
    Posts
    115
    Thanks
    7
    Thanked 12 Times in 12 Posts
    I've just checked the HTML output with text_diff, the only thing that popped up was the missing <!-- start header --> end <!-- end header -->.

    Funnily enough, the Copyright sign at the bottom is rendered differently too: original server doesn't show it, while the new one does. I'm guessing take a look at the Apache configuration and see what's the difference there.

  • #4
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I dont have any short codes I have the full <?php open tags to start the lines that include the header and footer. One thing about the header is that it is javascript based as it has drop downs and things but i cannot find any reason it shouldn't work.

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    If the HTML source matches yet its rendered differently, that indicates its the CSS. Check that the links aren't broken in the CSS.

  • #6
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Thyrosis View Post
    I've just checked the HTML output with text_diff, the only thing that popped up was the missing <!-- start header --> end <!-- end header -->.

    Funnily enough, the Copyright sign at the bottom is rendered differently too: original server doesn't show it, while the new one does. I'm guessing take a look at the Apache configuration and see what's the difference there.
    Yeah I just removed those lines trying to figure out what it is

    what part of apache would render this different ? I did some comparisoins on the old server and the new and found this:

    New: PHP 5.3.18

    Old: PHP 5.2.9

    New: Zend 5.5.0

    Old: Zend 3.3.9

    New: Apache: Server Version: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_bwlimited/1.4

    Old Apache: Server Version: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.9

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Apache won't render it differently. If the HTML source matches in both locations, this isn't a PHP issue, its a rendering one so its your HTML and CSS that's at fault.
    There are a lot of things different between these two servers setups. I haven't a clue what the differences between the Zend application are, but 5.3 and 5.2 have many differences (albeit most are object oriented and 5.3 is mostly backwards compatible with the exception of namespaces and constructors if they match the class names).

  • #8
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is an update

    Instead of including the header and footer files I copied the code right into the index and now the formatting is proper. Any idea why this would happen ?

    This is the code I was using to include the files:

    <!-- start footer -->
    <?php include("includes/footer_home.php"); ?>
    <!-- end footer -->

  • #9
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Possibly a filepath issue. That should have no impact if the output source is the same (as you claim it is). Change include to require and it will tell you if it can't read the file.

  • #10
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,298
    Thanks
    57
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    I'm just wondering Fou..

    Op says html is the same. Affected HTML is in an included file.. yet when copied out and pasted directly in it fixes the issue...

    You reckon it might be an encoding problem like I had months ago? That led to all sorts of strange behaviours for me and it did different things on different servers too.

    I could encode it as ansii on my system and all sorts of weird characters would show up but be fine on the remote server.

    I'm just wondering if that could be the case here..
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #11
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    That's possible, but I'd expect that a difference program would also see any bom's that may be added.
    The OP could try opening the files in notepad and ensuring its saved in ansi to remove the bom from it.

  • #12
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I updated my encoding to UTF-8 in Notepad++ alot of the files were ANSI so I made the ones I am working with for now UTF-8

    I changed this page: http://test.pmiindustries.com/about-pro-mold.php to require but still no luck.

  • #13
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Move it back to ansi from UTF-8.
    Still smells like either a CSS issue, or the HTML doesn't match as you say it does. BOM usually only affect PHP's ability to send headers (since you can't), so you won't be able to use sessions, cookies, redirections, etc if you save it as UTF-8 unless you use output buffering at an INI level.

  • #14
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just converted all of the files that I have in my includes (header, footer etc..) to ANSI and now it works the about page now formats properly. I still dont really understand why that worked but I will do some reading on google

  • #15
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    BOM decimated the output source. You need to use a better program to detect the differences between two strings; BOM are non-printable, but are still chars nonetheless. Pear's text_diff may work if you force it into UTF8, but I wouldn't be surprised if it doesn't either. PHP is not natively supporting UTF8 (unless one of the newer versions is), and I don't expect that it will until 6.0.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •