Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 webdev.lazer.net

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
1  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.