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

  • 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. Jan 5, 2011 at 18:20
  • Those sites work fine. I'm just updating the post with the installed packages
    – YXD
    Jan 5, 2011 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. Jan 5, 2011 at 18:47
  • Have you tried to clear the browers cache ? some browsers cache the types from previous requests. Jan 5, 2011 at 19:18

3 Answers 3


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.

  • Hey I think you're right. The site works in Incognito mode...
    – YXD
    Jan 5, 2011 at 22:30
  • And when I clear the cache.
    – YXD
    Jan 5, 2011 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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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