Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Done a basic setup of Ubuntu Server installing Apache, PHP and mysql through tasksel. When I browse to the IP address of the server it works fine and allows me to render PHP scripts fine.

I added a DNS entry for the server onto my local DNS server, calling it

When I go to this domain name through my browser it renders HTML documents fine but if I try to view PHP scripts it doesn't render and downloads in plain text to the browser (As if the PHP parser isn't rendering .php documents).

I'm sure its some rookie mistake, but any help would be appreciated.

share|improve this question
do you have two virtualhost blocks by any chance ? – Sandman4 Nov 12 '11 at 20:37
are you sure the dns entry resolves to that ip? try bash$ whois YOUR_DOMAIN_NAME to see which ip the dns entry resolves to. also, check to see you don't have another webserver running. i'm not sure if you have this set up via virutalhost or not, but make sure the ports are set to resolve to the appropriate webserver, in case you might have 2 running, but definitely a conf file would help – Robert Van Sant Nov 12 '11 at 20:47

Could you post the contents of your Apache configurations located in "sites-enabled"? It sounds as if you have different hosts set up, one responding on a NameVirtualHost base and another one serving default contents when accessed through IP. The NameVirtualHost entry will most likely miss an "ExecCGI" option so the PHP-interpreter is never executed. If you are using several site configurations, make sure you set up different access and error logs for each site, that'll make troubleshooting a bit easier.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.