PDA

View Full Version : ForceType


Shuttheduckup
27-05-2008, 17:40
My host installed suPHP so it won't allow to have folders set to 777, 2.38 version got some permission issues with var folder, upgraded to 2.39, everything works fine so far.

Downloaded PHP 5 version, installed without mod rewrite (somehow when using Apache 2.2 + PHP 5 on servers, your script doesn't detect mod rewrite). When I am trying to open pages, it download files instead.

I guess this is because of ForceType application/x-httpd-php in htaccess, I'm now using mod rewrite htaccess from my older script (2.xx) which got this line commented and everything works fine. Is this because of suPHP or?

Also, can you give me the latest .htaccess file content with mod rewrite on? Thanks.

I've now this:

DirectoryIndex index.php
<FilesMatch .\.php>
#ForceType application/x-httpd-php
</FilesMatch>
Options -MultiViews -Indexes +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond $1 !(\.css)|(\.js)|(\.ico)|(\.swf)|(\.jpg)|(\.png)|(\ .gif)$ [NC]
RewriteRule ^(.*)$ index.php [NC,L]

Not sure if it was changed...

nedisko
28-05-2008, 05:59
777 is needed when php is running under user (commonly it's apache or the like) other than yours when you upload files via ftp. If suPHP is used at the server, than 644 (and even 600 in some cases) should be suitable for php-scripts to get access to the folder or file.