Forum Moderators: coopster

Message Too Old, No Replies

Parse .inc files as PHP files?

How can I set my Web server configuration file to parse .inc files as PHP?

         

alcheme

10:22 pm on Mar 16, 2004 (gmt 0)

10+ Year Member



Does anyone know how can I set my Web server configuration file to parse .inc files as PHP files?

Thanks,

~Shane

Timotheos

10:42 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could always add this to htaccess
AddType application/x-httpd-php .php .php3 .phtml .html .htm .inc
which would make all files with these extension to be parsed as php.

I just always name my includes like filename.inc.php so I know they're includes but no matter what they get parsed.

alcheme

10:59 pm on Mar 16, 2004 (gmt 0)

10+ Year Member



Timotheos

I will try that... I hope that adding .inc will be it :-)

<quote>Timotheos said: I just always name my includes like filename.inc.php so I know they're includes but no matter what they get parsed.</quote>

According to webmonkey.com: "I like to use the suffix .inc with my include files so I can separate them from normal PHP scripts.[...]hackers might be able to guess the name of your include files and display them through the browser as text files. This could be bad if you've got sensitive information - such as database passwords - contained in the includes."

Timotheos

11:09 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes the monkey is always right. Long live the monkey! [webmasterworld.com].

See how I have two extensions on that filename so it's always treated as a php file.