Page 1 of 1

Whats an inc file?

Posted: Sat Apr 05, 2003 8:10 am
by Sly
Can someone explain to me whats an .inc file?
and what does it do between php and asp
whats the relation of them
can someone plz explained it to me like i am 3 years old?

Posted: Sat Apr 05, 2003 11:14 am
by volka
it's just a file with another extension and a bad idea if it stands for include and contains php-code. For php it does not matter which extension a included file has but for the webserver it might and only the least are configured to let php handle *.inc or ignore that request. If this file is within your webdirectory someone might request it and will (probably) receive the source-code, very bad if it is secretAndValidFromWorldDbPass.inc ;)
use secretAndValidFromWorldDbPass.inc.php instead if you must.

Posted: Sat Apr 12, 2003 6:12 am
by m3mn0n
PHP is configured so thoses are handled like regular text files instead of php code. It's very simple to set them to be handled like php in your web server config area. In apache this is how:

open /conf/httpd.conf

before:

Code: Select all

#
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
after:

Code: Select all

#
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .inc