Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

On my local environment I require_once publiccontroller.php and it'll load publicController.php

Unfortunately when I go to production on HostGator it will fail because it's not loosely requiring/including files. Is this a PHP or Apache thing? I need my environments to be mirrored so I'd like to change my local setting to match my production server.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
408 views
Welcome To Ask or Share your Answers For Others

1 Answer

Filesystem case-sensitivity is not a PHP setting, but rather specific to the OS and filesystem. Windows filesystems tend to be case-insensitive, while most other operating systems prefer case-sensitive filesystems.

Since you cannot necessarily predict what OS your code will run on in the future, it is recommended to always code for case-sensitive fileystems.

If you are currently developing on Windows (or any other OS with case-insensitive filesystems), the best course of action is to return to your code and fix all the file paths to use the correct casing, matching what they are named on disk.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...