andrei
andrei

Reputation: 8582

lowercase and uppercase file name

I used codeigniter framework on my localhost, i named some of my models and controllers using the camel case method(UserModel,DbModel) on windows.Now when i uploaded the files to the server(running on linux) the script is trying to load all the files with all lowercase so i get 404 errors because the script is looking for usermodel not UserModel, any way to go around this ?

Upvotes: 5

Views: 4619

Answers (3)

Mchl
Mchl

Reputation: 62395

Welcome to the 'pissed by crippled spl_autoload() implementation' club.

You basically can either

1.Rename all your files to lowercase

or

2.Write/find an autoloader that looks for proper filenames. Here's Symofony's ClassLoader Component which works great.

Upvotes: 8

Reallyethical
Reallyethical

Reputation: 1825

Linux file names are case sensitive unlike windows. So you must be explicit in what you call. Change the script to use the Pascal Case method you are showing above and it will function correctly.

Alternatively set a redirect in your web-server, to look for the Pascal Case version of the file.

What language are you using and what web server?

Upvotes: 0

dmcnelis
dmcnelis

Reputation: 2923

Windows doesn't store file names with case sensitivity. You'll need to either rename your files on the linux machine, or force all of your file references to lower case.

Upvotes: 0

Related Questions