I am currently designing a website and at the moment it is getting quite annoying as the design doesn't seem to be displaying properly when testing it through WAMP in server mode. It displays perfectly well if I simply double click the php file and display it without any server code, however this is also frustrating as I would like to be able to see my server code with my design. I have already cleared the cache, and I still get the same result...

Any help on this situation?

  • Have you tried making a simple test page, mostly plain html, but with a single php echo statement that should only get output via web server? If so how does this behave?
    – ToniWidmo
    Jun 3, 2013 at 18:26
  • This is probably a better fit for StackOverflow; in the meanwhile, can you add a snippet of a page that doesn't render correctly? It's hard to give you a real answer, otherwise.
    – Tieson T.
    Jun 3, 2013 at 19:53

3 Answers 3


This is a bit tricky to answer. There are obviously some big differences between displaying your page offline to online (in your test server). All URL paths (root-relative, absolute and even relative) are going to be different depending on your setup. Content-Type headers (normally sent from the server) could differ, so files are interpreted differently, etc.

This is assuming your server-side (generated) HTML is not breaking your layout.

  • It is confusing me. I did manage a work around. Internet Explorer works perfectly for the website (I know... IE?) however firefox and google chrome (chrome has just been installed, never used before on this machine) seem to fail to load the images when the page is being read through the server, however It seems to display perfectly when just in plain HTML format or when it is in IE through the server.
    – Brandyn
    Jun 3, 2013 at 8:26
  • 1
    What are the paths/types of these images? Are the images simply not being found? Or are incorrect mime-types being sent? IE is likely to be a lot more forgiving in this respect - although this does not necessarily mean it is correct. You can check the HTTP response headers in Chrome developer tools.
    – MrWhite
    Jun 3, 2013 at 8:31

To start I would make sure with a very simple PHP file and try with

   echo "Hello world!";


   echo "Hello world!";  

Make sure you don't have any new line after the closing quote ?>.

This are silly error that can make you waste lots of time.

Then start to introduce new functionality one by one until your server break and you will know what is wrong.

Good luck.

  • <?p? A newline after the closing PHP delimiter (?>) is only really a problem with included PHP files (where the entire file is PHP) that contain no output. In such files the closing PHP delimiter can/should be omitted entirely to avoid such situations ("output already started a line...." errors). But as stated in the comments above, there does not appear to be any PHP errors.
    – MrWhite
    Jun 3, 2013 at 15:04

It is not the cache problem. If you are using any server side programming language like PHP, then you have to place your files on the server (like your local server WAMP). Place your php files there, and then open it in the browser like


If you are code has no errors, then it will display the page correctly, and if it has any errors , then it will not work fine or will display errors / warnings / notice etc .

Also at the top of your php file, place the below code to enable errors so you can see if there are any errors in your php code:


Hope this will help.

Thank you

  • I am aware of the basics of web developing and I do know that my PHP file should be in my local server file. It is not all of the style that isn't being displayed, rather just parts that aren't, whereas if I open just the php file through my harddrive location and not the server ,all of it displays.
    – Brandyn
    Jun 3, 2013 at 6:32
  • if you have a fatal error in your php file, then it will not display any contents on the page, just a blank page will be displayed. You have to debug your php code. When you open it directly from your hard drive, it will show the design fine, but it will also show the php code, and it is because, the php code is not run. Jun 3, 2013 at 6:34
  • There is no error, I have thoroughly checked it and checked the developer console and enabled error_reporting. There is nothing wrong with the PHP
    – Brandyn
    Jun 3, 2013 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.