-1

I'm running XAMPP.

Is there a line I can add to .htaccess or http.conf to make ASP be parsed and handled as PHP pages?

I had it setup before but can't remember how to do it. What I've tried so far hasn't worked.

Edit: None of these solutions are working, I've tried everything.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
guitar-
  • 1,051
  • 5
  • 15
  • 21

6 Answers6

4

If none of the solution above is ok with you, check your Server API with phpinfo(); method.

If Server API is CGI or FAST CGI change it to Apache 2.0 Handler.You can do it using Plesk Panel or CPanel.

Another option is not to change Server API but .htaccess or httpd.conf : http://avinashsing.sunkur.com/2012/04/19/how-to-map-another-file-extension-to-the-php-parser-through-htaccess/.

But I have solved my problem with the first one.

demircan
  • 231
  • 4
  • 9
2

Maybe try this:

AddHandler php5-script  .php .asp .aspx .ascx .ashx .asmx
AddType text/html .php .asp .aspx .ascx .ashx .asmx
funwhilelost
  • 1,990
  • 17
  • 20
1

Try adding this line to .htaccess;

AddHandler application/x-httpd-php .asp

Apparently it is not as efficient as adding the equivalent to http.conf but it works even when you don't have access to http.conf.

robert
  • 33,242
  • 8
  • 53
  • 74
Jose Simas
  • 11
  • 1
1

Adding this line in .htaccess enabled me to execute PHP code written in .asp pages:

AddHandler php5-script .php .asp
nhahtdh
  • 55,989
  • 15
  • 126
  • 162
1

Add this to your httpd.conf

AddType application/x-httpd-php .asp .aspx .ascx .ashx
funwhilelost
  • 1,990
  • 17
  • 20
0

Apache does not have a module for ASP processing. You have to use IIS for that. Modern IIS can run PHP so you may do it the other way around, use IIS and plug PHP into it.

Palantir
  • 23,820
  • 10
  • 76
  • 86
  • I'm just wanting to have Apache run a .asp file as if it were a PHP file, there is no actual ASP code. – guitar- Jul 16 '10 at 08:45
  • aah, ok, then you just need to add the handler for the file extension. Go to your apache config file and look for where it associates .php to the php module. It's like this, just add asp extension instead of html: http://www.besthostratings.com/articles/php-in-html-files.html – Palantir Jul 16 '10 at 09:58
  • "Apache does not have a module for ASP processing." mod_mono disagrees with you, at least for ASPX. – Powerlord Jul 21 '10 at 17:52