G'day Guys,
What is an .inc file?
Yep, I know it's interchangable with .php, I've tried it and I've googled a lot but why .inc and not .php?
any links *or* keywords to help me get my head around this appreciated.
tia
bladecatcher
What is an .inc file
Moderator: General Moderators
At first I thought .inc is parsed by PHP. But I had my files like xxx.php.inc. Using IIS, if the extension is inc which is not a valid php file. But using Apache (Windows and Linux), somehow it parses as php. In fact, in Apache, any file having .php anywhere (not necessarily at end) will be parsed as php.
This is how its working on my PC and web host.
This is how its working on my PC and web host.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Normally use can use .php for core code. If a php file contains "include <filename>;" these <filename>'s are frequently named *.inc to indicate that the file is included into one or more .php files. This is purely a user convention.
How they get processed if referenced via url is dependant upon your server settings.
How they get processed if referenced via url is dependant upon your server settings.
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I just keep all my include files as .php but under an "includes" directory. As you say it's just a preference.Maugrim_The_Reaper wrote:Some may use .inc.php - simply to ensure it is parsed correctly. .inc is simply a user preference - something to mark that a file is included into other PHP files, and not necessarily directly accessible (or accessible in any meaningful way) by a browser.