0

I have a new project and I have extracted its source-code, ran its database dump, but when I want to run it, instead of running the PHP files, it downloads them. How can I modify it to run the files instead of downloading them? The online version runs the files and my local server works well for other projects. The .htaccess looks like this:

Options +FollowSymLinks
RewriteEngine on

# Use PHP 5.4
AddType application/x-httpd-php54 .php

RewriteRule ac-(.*)_id-(.*)_eid-(.*)_delete-(.*)-(.*)\.html ?activation_code=$1&id=$2&edited_id=$3&delete=$4&page=$5
RewriteRule ac-(.*)_id-(.*)_delete-(.*)-(.*)\.html ?activation_code=$1&id=$2&delete=$3&page=$4
RewriteRule cod-(.*)_user-(.*)-(.*)\.html ?activation_code=$1&user=$2&page=$3
RewriteRule s-(.*)_id-(.*)-(.*)\.html ?sterge=$1&id=$2&page=$3
RewriteRule r-(.*)_id-(.*)-(.*)\.html ?raspuns=$1&id=$2&page=$3
RewriteRule t-(.*)-(.*)\.html ?AdType=$1&page=$2
RewriteRule f-(.*)-(.*)\.html ?from=$1&page=$2
RewriteRule e-(.*)-(.*)\.html ?edit_id=$1&page=$2
RewriteRule i-(.*)-(.*)\.html ?i=$1&page=$2
RewriteRule c-(.*)-(.*)\.html ?c=$1&page=$2
RewriteRule (.*)\.html ?page=$1

What could be causing this behavior?

EDIT: My question was marked as a possible duplicate of the question which can be found here. While the two questions are undeniably related, I believe that my question is not quite similar to the other question, since, as my question of

What could be causing this behavior?

indicates that I want to understand the behavior, while the other question dealt with solving a problem, this is why versions were specified in the question. While my opinion is subjective here, I welcome any comments or close votes.

Community
  • 1
  • 1
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
  • I suspect you should not be using `AddType application/x-httpd-php54 .php` but instead `AddType application/x-httpd-php .php` – miken32 Nov 24 '15 at 23:51
  • @miken32, I have tried that and the PHP files were running. Unfortunately the project is not documented and this change of .htaccess would be versioned, so I need to understand what happened. For that, I need to know what application/x-httpd-php54 means? Is that the version of PHP? 5.4? And does application/x-httpd-php mean PHP of any version? – Lajos Arpad Nov 24 '15 at 23:58
  • 1
    I've never seen anything but `application/x-httpd-php` used before. It's a pseudo MIME type that signals PHP to process the file. PHP version is dependent on which module is loaded, e.g. `LoadModule php5_module modules/mod_php55.so` in `httpd.conf`. – miken32 Nov 25 '15 at 00:01
  • I think the 54 there means the version as the comment of # Use PHP 5.4 suggests. – Lajos Arpad Nov 25 '15 at 00:04
  • And the problem was probably that the version of PHP on my local server did not match the version of 5.4. which resulted in the error. – Lajos Arpad Nov 25 '15 at 00:04

0 Answers0