Downloading Php Files (WordPress-Virtual Host)

A little background: I just got my linode on Sunday and installed it using the LAMP StackScript (Ubuntu 12.04). Apache works, and PHP appears to be working (I created a test page that gave me php info). I then created a virtual name host to MySite.com (example name of course) which has a DocumentRoot of /home/mysite/public_html

Now I'm installing wordpress. Things seemed to go okay, process went through just fine, brought me to the admin login page, yay. However, when I attempt to go to mysite.com, a file (download.php) is downloaded. If I try to to IPAddress/mysite I download the same file. IPAddress/mysite/index.php, it downloads index.php.

I've done some googling and seen other people with the same problem, so I added the following to the end of my apache2.conf file:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

Restarted apache and….no difference. If I go to my regular site (IPAddress or the Linodename), I get the temporary index.html file I put up

After working on this for several hours, I'm just plain confused. I haven't really had issues with this before on a past server, so I'm assuming it's just a configuration option I messed up. Any thoughts/suggestions that can point me in the right way?

Thanks

H

2 Replies

H,

Instead of````
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

try this````
AddHandler php5-script .php .html .htm
AddType text/html .php .html .htm

and restart apache. It's what I have at the end of my U 12.04 apache2.conf file.

I've never used the -source or .phps extensions, so if my suggestion works - and you want/need the .phps extension - you may just have to find a syntax that matches.

After some fustrating times with it, I ended up reloading my host and installing LAMP by hand, rather then using the stack script. That seemed to work out.

I did notice that if I turn on the userdir mod, it attempts to grab the php files as well. Turns out userdir mod had the php engine turned off. Simply commented out the code (as per http://devplant.net/2010/05/04/linux-ph … blic_html/">http://devplant.net/2010/05/04/linux-php-not-working-in-userdir-public_html/ ) and it worked.

Thanks for the suggestion though.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct