New type file

remikk

Verified User
Joined
Apr 30, 2008
Messages
165
Location
Poland
Where should I add new type to interpreter PHP in Apache.
My file is name "engine". This is file from software which I use.
Documentation says me that I should add :
Code:
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml engine
<IfModule mod_alias.c>
    Alias /edokumenty /home/edokumenty/public_html
</IfModule>

<FilesMatch "(.+[.]inc$|.+[.]php$|engine)">
    SetHandler application/x-httpd-php
</FilesMatch>

<Directory /home/*/public_html/>
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride Options
    Order allow,deny
    allow from all
</Directory>

Because I have php-cgi with suphp I add :
Code:
IfModule mod_suphp.c>
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps|engine)$">
AddHandler x-httpd-php5 .inc .php .php3 .php4 .php5 .phtml .engine engine engine.php
AddType x-httpd-php .php .inc engine
</FilesMatch>
<Location />
and
also in httpd.conf
Code:
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi engine.php engine
</IfModule>
But still when I browse this site I see code php in my browser.
 
You should use add a .htaccess on your website root that should be something like this:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps|engine)$">
AddHandler x-httpd-php5 .php5 .inc .php .php3 .php4 .phtml .engine
</FilesMatch>

Regards
 
I tried this but still doesn't work.
My file has name "engine" not "something.engine".
I tried change engine to engine.php and everything is ok. But I can't use this, I need file engine because all software will not work correctly with engine.php.
 
Add this in .htaccess near to engine:

Code:
<FilesMatch "engine">
ForceType x-httpd-php5
</FilesMatch>
 
Back
Top