PDA

View Full Version : New type file



remikk
02-26-2011, 01:33 AM
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 :


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 :

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

<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.

SeLLeRoNe
02-26-2011, 03:18 AM
You should use add a .htaccess on your website root that should be something like this:


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


Regards

remikk
02-26-2011, 04:16 AM
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.

SeLLeRoNe
02-26-2011, 05:02 AM
have you tryed my conf removing the dot on engine?

remikk
02-26-2011, 05:23 AM
have you tryed my conf removing the dot on engine?

Yes. I did :
.engine engine
and
engine alone

zEitEr
02-26-2011, 11:23 AM
Add this in .htaccess near to engine:


<FilesMatch "engine">
ForceType x-httpd-php5
</FilesMatch>

remikk
02-26-2011, 03:14 PM
Zeiter now it's work. Thank you.