Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Wordpress installed at http://localhost/wordpress

When I try and view a page in Chrome, it downloads the PHP file rather than showing the page. When I view in Firefox, everything works fine.

when I create localhost/test.php containing simply <?php echo "hello world" ?> it displays in both browsers.

Any ideas on what might be wrong?

$ dpkg -l | grep apache outputs: apache2, apache2-mpm-prefork, apache2-utils, apache2.2-bin, apache2.2-common, libapache2-mod-php5

share|improve this question
    
Did you tries other php pages like facebook, php.net, etc... If Yes what modules do you have installed in apache. For example in my case i have only the one about php and apache libapache2-mod-php5. please verify with synaptic which is easier to see what you have installed with apache. –  Luis Jan 5 '11 at 18:20
    
Those sites work fine. I'm just updating the post with the installed packages –  Mr E Jan 5 '11 at 18:36
1  
am guessing you have php5 installed and also did not do any changes to apache. Is this correct? so i can start testing. –  Luis Jan 5 '11 at 18:47
    
Have you tried to clear the browers cache ? some browsers cache the types from previous requests. –  João Pinto Jan 5 '11 at 19:18

3 Answers 3

up vote 6 down vote accepted

This is likely due to a caching issue. Try clearing your browsers cache - then closing Chrome all together (Everything: all tabs and windows). This happens to me when I'm working on servers and make a change to either .htaccess or php module. I'll get the page download then my browser will remember that that.

Lastly restarting your Apache installation can help reset header information.

share|improve this answer
    
Hey I think you're right. The site works in Incognito mode... –  Mr E Jan 5 '11 at 22:30
    
And when I clear the cache. –  Mr E Jan 5 '11 at 22:35

The inverse happened to me: Firefox was downloading the php file and Chrome was showing the site itself. Clearing the cache did the trick.

share|improve this answer

If you have downloaded the code from server to your local machine. Then it's because of .htaccess file. Clear the cache then rename .htaccess to say htaccess.txt. Then you should see the webpage this time. Now your links might not be working in wordpress. So to correct this go to admin http://localhost/(wordpress-folder-name)/wp-admin . In admin panel on left side bar click on settings>>permalinks then click on "save changes" button at bottom of page. This will create or re-write new .htaccess file. Done everything should work well.

share|improve this answer

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.