Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows Linux PHP
Hello all,
 
I'm developing a web site with my Windows 7 computer, I've installed EasyPHP (a php server with mysql... like xampp).
 
The problem I'm having here is that there are plenty of files involved in the site and Windows is not case sensitive so if for any reason I've made any mistake in the name case windows loads it without problem and I don't notice that problem.
 
When I upload the site to the linux production server then I'm facing the problem that all the links that point to an incorrect case file point to the 404 page...
 
Is there any way to configure EasyPHP or windows to become case sensitive? I can't change the behavior of the remote server...
 
I've been looking at the Internet for a while looking for an answer to my question and it seems that it is not possible, but anyway, I've tought on asking it here and cross fingers... I would like to avoid to put a linux virtual machine only to develop the web site.
 
So in order to summarize:
 
1) the production server is linux.
2) the working computer is windows.
3) windows handles files as non case sensitive. Linux does it as case sensitive.
4) when I port my local web to the production server I got problems due to the case sensitive linux way to work.
5) I would like to know if I can configure the working computer to react like linux in that case sensitive issue to avoid the need of a virtual machine.
 
As always, thank you in advance! Thumbs Up | :thumbsup:
Posted 2-Mar-12 1:37am
Joan Murt82.8K
Edited 2-Mar-12 1:49am
v2
Comments
Schehaider_Aymen at 2-Mar-12 6:47am
   
do u wanna avoid the use of a virtual machine or the use a linux virtual machine or what exactly ???
Joan Murt at 2-Mar-12 6:50am
   
Updated the question, added a summary, probably it is clearer now.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use a virtual environment (you can use virtualbox which is free and supports both 32-bit and 64-bit) or simply always use lowercase filenames preventing this.
 
Good luck!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can specify that NTFS be case-sensitive, but that might break other apps. Best practice ina multi-platform environment is to simply add code to normalize the folder and file names INTERNALLY to your application..
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Windows is case-insensitive in file names but preserves the case of the nomenclature.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

You could add an include to your source files to warn you of any case mismatches:
 
<?php
$filename = basename($_SERVER['SCRIPT_FILENAME']);
$request = basename($_SERVER['SCRIPT_NAME']);
 
if($filename != $request)
  die('Case of filename and request do not match!');
 
 
[edit] ... this doesn't help with links to non-PHP files though.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 2 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100