-1

I am using a WAMP stack at home to do most of my coding, and have hired a hosting company that uses a LAMP stack to host my data.

One of the most annoying things that this is causing me is that images in my html need to be in the form of <img src = 'images/subdirectory/file.jpg'> to show properly on my windows box, but <img src = '**/**images/subdirectory/file.jpg'> to show properly on my hosted (live) page. Is there a way I can set up my WAMP at home to require the same path style as the LAMP?

Also, on a side note, I've run in to issues with Linux pats/files being case sensitive and windows not causing confusion.

Izzy
  • 8,224
  • 2
  • 31
  • 35

2 Answers2

4

If you want to spare yourself a lot of pain and suffering, you should try to make your development environment mirror your production environment as closely as possible. You should be using the same versions of all the relevant software (i.e, the same version of PHP, Apache, etc.) -- and definitely the same OS. It's just way too much of a hassle to convert code between platforms.

Fortunately, you can do this on your Windows machine. I'd recommend that you set up a Linux virtual machine on your Windows box, running under VMWare (there is a free version you can download), and I'd get it running the same version of the OS that your host runs. Once you get it up and running, download and install the same versions of the relevant web software that your host runs. (They should make this information available to you.)

This way, you can develop within a Linux environment that mirrors your production environment, while still running Windows. It will take a little time to set up properly, but you'll save yourself a lot of stress when pushing out your code to the production environment.

bigmattyh
  • 308
  • 1
  • 2
  • 9
  • 2
    Having previously tried to dev on a different platform (Windows) to the production system (Linux) I wholeheartedly agree. Even just a version difference of the PHP install gave me no end of trouble. +1 – John Gardeniers Oct 30 '09 at 02:38
1

Windows is only sorta case-sensitive on path names (depends on the file system, among other things). The httpd server you're running should be case-sensitive, even where the OS is not.

Also - you're first img tag is using a relative path from the current directory, where as the second one is using a full-authority path (if I read you correctly).

warren
  • 18,369
  • 23
  • 84
  • 135