Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I Installed Wordpress under (UBUNTU)/var/www/wordpress. wp-config.php is modified as recommended.

When trying to access http://x.y.z.a/wordpress/wp-admin/wp-install.php it doesn't open the page but instead downloads the file...

share|improve this question
add comment

closed as off topic by Su', John Conde Feb 23 '13 at 19:08

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

You must have to install xampp to run .php files. Because web browser doesn't understand .php files.

PHP files are rendered in Server like Apache and then it work in web browsers.

share|improve this answer
    
Did you read that OP has an Ubuntu server? None of xampp or wamp can run on his server... –  j0k Feb 23 '13 at 8:52
    
@j0k: There appears to be plenty of tutorials out there for installing xampp under Ubuntu?! I haven't tried; can you confirm? Thanks. –  w3d Feb 23 '13 at 9:35
    
@w3d oh yeah, you're right. I was (almost) sure that xampp was only available in gui, not in cli. –  j0k Feb 23 '13 at 9:49
    
@j0k my thoughts exactly why the heck is XAMP being suggested when OP said he's got WordPress installed on Ubuntu. Even if XAMP can install on Ubuntu as w3d decided to point out which is just ridiculous to do IMHO and i'm sure many others agree. Bybe has the best answer update and re-install the proper packages. –  Anagio Feb 23 '13 at 18:01
add comment

PHP is not installed or not configured properly on your server, Install LAMP or install php and configure it manually. There are instructions for doing so here: https://help.ubuntu.com/community/ApacheMySQLPHP

Edit:

If php is installed but still there is the same issue of being downloaded, it means that the apache/php configuration is not done right.

If you have recently installed any plugins relating to php and apache, make sure to restart apache before the new settings take effect:

/etc/init.d/apache2 restart

If still not working, try to follow the recommendation in here: http://serverfault.com/questions/215455/what-causes-php-pages-to-consistently-download-instead-of-running-normally

If that is too hard because you are not experienced with linux/ubuntu, then you should uninstall apache/php/mysql, and reinstall them again, which should make the appropriate settings, but this time follow a guide from the start like the one posted above.

share|improve this answer
    
Hello Stephen Ostermiller - I need your help. I have spent many days to solve this issue and I am not going anywhere. I looked at the page that you sent me and I checked apache and php looks like both are running in my server. I also wrote a test.php and I tried to open it but it is also getting downloaded. I know I am close to it but I cannot make that working. Please help. –  Prasad Feb 23 '13 at 17:12
    
one more data point that I want to share is that I am operating everything under root. I have not created any user yet. –  Prasad Feb 23 '13 at 17:32
    
@Prasad I have edited the post with more info. –  sharp12345 Feb 23 '13 at 17:45
    
Thanks Sharp. I will your suggestions and I will let you know. –  Prasad Feb 23 '13 at 17:53
    
@sharp12345 he said he's installed WordPress on Ubuntu, why would you say to install LAMP as if LAMP is some application. He's already on Linux. bybe has posted a better answer –  Anagio Feb 23 '13 at 17:57
show 1 more comment

You need to install PHP5 which is really easy just follow my 5 simple steps and voila your done.

  1. Connect to your Ubuntu using SSH or bring up the terminal if using Desktop.
  2. sudo apt-get update
  3. sudo apt-get install php5
  4. sudo apt-get install libapache2-mod-php5
  5. sudo /etc/init.d/apache2 restart

All done and PHP should now work, you may run into MySQL problems if you have not installed this either... let us know if you encounter any more problems and I'll assist.

PHP5 installed but prompted to download php file

  1. Enable mod_write - sudo a2enmod rewrite
  2. Enable .htaccess sudo nano /etc/apache2/sites-available/default find the lines with the directory setting i.e /var/www find AllowOverride none and change to AllowOverride All
  3. Now create a blank .htaccess file if you don't have one already sudo nano /var/www/.htaccess add the following line AddType application/x-httpd-php .php .htm .html and this one below it AddHandler x-httpd-php .php .htm .html
  4. sudo /etc/init.d/apache2 restart
share|improve this answer
    
Hello bybe , I did the steps that you suggested, I still get the file downloaded. :( Please help –  Prasad Feb 23 '13 at 17:19
    
When I run >>>>> sudo a2enmod php5 It says >>>>>>>> Module php5 already enabled –  Prasad Feb 23 '13 at 17:23
    
Just updated my answer. give that a true. Basiclly if you have PHP installed then the problem is that it doesn't understand the MIME and you need to AddType Application. –  bybe Feb 23 '13 at 19:48
add comment

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