0

I have a web application written in PHP, html and JavaScript.

On my PC, I have installed the EasyPHP program which has Apache and everything installed.

I wanted to put this web app on my server and I have installed Apache 2.0, but my php files are displayed as text or downloaded automatically.

I have tried several things, one of which is to add the below to my conf file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

But it's still not working.

What else can I do?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
user123_456
  • 123
  • 5
  • Did you restart your apache server after changing the configuration? Also, it will be more helpful to post your apache config. – Khaled Sep 19 '12 at 07:48
  • yes I have restared. But funny thing is that I have 2 config files one is config.default and other one is config. I have tried to change each of it and still same thing. You mean to post everything in here? I think that would be too much code. Basically I didn't change anything else except this lines that I have wrote and path of my folder which doesn't change anything – user123_456 Sep 19 '12 at 07:51
  • Have you actually installed PHP on the server, e.g. `mod_php`? I know that seems like an obvious step, but you mention installing it on your PC and don't mention installing it on the server. – pjmorse Sep 29 '12 at 00:47

1 Answers1

0

Don't use XP as a server operating system, because it's not one.

If it's gotta be that generation of Windows OSes (also a really bad idea), at least put Server 2003 R2 on there. It shouldn't be too hard to find a legit copy on the cheap; I personally use the Server 2003 discs as coasters. A much better idea would be to get an appropriate edition of Server 2008 R2 or 2012, but that would be more expensive than an OS that's largely abandoned or being abandoned rapidly.

As to actually correcting the problem, you haven't given enough information to really troubleshoot this, but the .php files being downloaded or displayed instead of executed is a browser setting (that can be influenced by a number of other things, which you haven't given enough information about). Look into how to change how your browser handles .php files and/or try your luck with a different browser and see if it just works after installing a new one.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208