oscartheduckin’ around

April 19, 2007

“application/x-httpd-php” downloading instead of being served by wordpress on freebsd

Filed under: apache, freebsd, how to, wordpress — oscartheduck @ 1:12 am

I did a fresh install of apache, wordpress etc for a friend today. Made a slight mistake in the order things were installed, such that instead of delivering WONDROUS wordpress documents, instead I was getting a download link for application/x-httpd-php. I was like “What the fudgemister is this?”

I did the sensible thing and goooooooooogled around a bit and found people saying that they couldn’t fix it except if they increased the amount of swap PHP was accessing.

Now, when I hear something like that I figure that’s a bullshit answer. What the hell does increasing PHP’s swap have to do with whether apache is interpreting the php file properly? And when I read the stats on some of the machines that were complaining about this, hell, they have more RAM available to them than I have swap + RAM on this machine, and some of my friends are running on machines that make my pentium3 500mhz, 128mb RAM machine look positively mighty. Not that that’s a bad machine at all, I’m rather pleased with it as a web server, but it’s nada by modern standards.

Anyway, where was I. Oh yeah, how to solve this issue? Well, as I say, I saw it as apache wasn’t interpreting the page but was instead serving it instead. So I had a lead.

I checked out httpd.conf and discovered that there was no line reading “php5_module”. I thought that was downright odd. It’s a consequence of installing apache after php, it seems.

I added the line “LoadModule php5_module libexec/apache22/libphp5.so”. But libphp5.so wasn’t installed.

The simple answer was to reconfigure php5. I installed it from the port, which is the only way I install software because I have a few custom flags in gcc so that stuff is compiled specifically for the p3 architecture. Anyway, how to solve this is: cd /usr/ports/lang/php5 && make configure —– make sure that the mod_php is checked and reconfigure that sucker.

If that doesn’t work, try out the php swap thing. Googling around will tell you how to do that, but for me the issue was mod_php not being installed. FreeBSD makes it very simple to install mod_php, as you can see. If you’re using OpenBSD, which is a badass OS, I imagine it’s exactly the same procedure, though I’ve never done it. Other OSes? I dunno, but google around for instructions. For example, a simple google for “mod_php install debian” revealed http://www.virtualmin.com/bug-tracker/bug?format=table&f_state=7&bug_number=563&project_id=1697, which tells you how to solve for debian.

But you should just install FreeBSD or OpenBSD, learn those systems and use those. They’re tasty.



  1. I wanted to leave a note:
    I had the same issue caused by a similar problem. And you are absolutely right about the swap…

    A good place to double check if you are using Apache2 and php5 is in the mods-available directory. Open php5.conf and make sure that the it reads something like this
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .php4 .php5

    I had to add the last line to get it to work for me.

    Comment by kjdash — July 25, 2007 @ 4:18 pm

  2. Hello – just wanted to comment that kjdash’s note about solving the problem helped me install Deki Wiki on Ubuntu. For some reason, this line was the key to make it all work. Thanks!

    Comment by Rick Cogley — November 24, 2007 @ 12:09 pm

  3. Same problems I am facing when I tried to open my blog http://googleway.net/blogs

    I have tried your advice but nothing working. pl help me. I have also added wron apache handeler wich counld not be deleted from cpanel. pl guide me to delete this wron handler.
    Handeler: application
    Extension .x-httpd-php.
    my email: skm25m@ymail.com

    Comment by sk — October 5, 2008 @ 6:53 am

  4. Hey, sk.

    Unfortunately, I don’t have an answer for you; I’m not a cpanel user at all. Try contacting your hosting provider and asking them about it.

    Comment by oscartheduck — October 5, 2008 @ 11:13 pm

  5. Hi

    Found the issue.
    You need to have the module mod_php5 installed and configured in your httpd.conf file.
    For Solaris use pkg-get -i ap2_modphp5 which is for php5
    mod_php4_core, mod_php and mod_php5 is for Apache 1.3x

    Comment by Martin Du Plooy — February 13, 2009 @ 2:15 pm

  6. […] a server problem: .htaccess, AddType application/x-httpd-php .php .htm .html, and maybe a Fix… https://oscartheduck.wordpress.com/20…ss-on-freebsd/ Need a Web Host ? Save up to $84 when you purchase hosting from Dreamhost.com. Use the coupon […]

    Pingback by application/x-httpd-php error | Pligg CMS Forum — May 5, 2009 @ 3:23 pm

  7. Hi all,

    I got the same problema with this applicationx-httpd-php

    Install the package:


    That’s all ! 🙂

    Comment by ToneX — July 30, 2009 @ 8:56 pm

    • you saved my bacon thanks chief

      Comment by big T — September 10, 2011 @ 7:41 am

  8. Nice tutorial 🙂

    Comment by webdesign — September 18, 2009 @ 10:58 am

  9. When I tried to install the package libapache2-mod-php5, it showed me ‘nothing to do’ and when I yum listed it, it showed ‘No matching Packages to list’.. please help me soon..

    Comment by Sony — April 3, 2010 @ 5:18 am

  10. I had the same problem, installing joomla 1.5 into my subdomain in Paralel plesk. I read the first post of this discussion, really helpful actually, didnt even do some coding or install anything, just simply tick the PHP Support on the subdomain. And problem fixed. My mistake was merely not ticking PHP Support option upon creation of subdomain.

    Comment by Jamirawan — March 23, 2011 @ 12:31 pm

  11. KyIDva http://gdjI3b7VaWpU1m0dGpvjRrcu9Fk.com

    Comment by frenky — May 8, 2011 @ 7:10 am

  12. Could I have a statement, please? young models toplist

    Comment by Ogdvakbi — September 8, 2011 @ 7:59 am

  13. Where do you live? bikini men pics veqd

    Comment by Ndplvhdn — September 17, 2011 @ 7:37 am

  14. Free medical insurance Gay Models Gallery

    Comment by Ehpnketn — September 25, 2011 @ 10:45 am

  15. Affordable Health Insurance Plans Compare Health Insurance Plans

    Comment by ToignSene53 — November 4, 2011 @ 3:59 pm

  16. Yes, I play the guitar http://ydelabysaec.de.tl katie grace model where is this at Germany ? what happens if seen by a cop ? they allow this in Germany ?

    Comment by Cuscsvhd — May 4, 2012 @ 5:29 pm

  17. When can you start? http://upihykyhery.de.tl shy lola porno I would worship that ass forever. That’s damn fine. I don’t usually go for blondes, but she is one cute little slut.

    Comment by Fnzddarv — May 7, 2012 @ 12:55 pm

  18. thanks for your answer

    Comment by hintçe — May 31, 2012 @ 8:57 pm

  19. your answer is so nice…

    Comment by hintçe — May 31, 2012 @ 8:57 pm

  20. you found a good answer

    Comment by shreya ghoshal — May 31, 2012 @ 8:58 pm

  21. Hi! Someone in my Facebook group shared this website with us so I came to take a look.
    I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to
    my followers! Terrific blog and brilliant design.

    Comment by promo code for bluehost — February 10, 2013 @ 9:23 am

  22. Its like you read my thoughts! You seem to understand so much approximately this, like you wrote the guide in it or something.
    I think that you just can do with some p.c. to pressure the message home a bit, however other than
    that, this is great blog. A fantastic read.

    I’ll certainly be back.

    Comment by JustHost Promo Code — May 16, 2013 @ 1:35 am

  23. At this time I am going away to do my breakfast, when having my breakfast coming
    over again to read more news.

    Comment by free live sex rooms — June 17, 2013 @ 2:47 am

  24. I am curious to find out what blog platform
    you’re utilizing? I’m experiencing some minor
    security problems with my latest site and I would like to find something
    more safe. Do you have any suggestions?

    Comment by Jonathan — June 24, 2013 @ 6:06 am

  25. You’re so awesome! I do not think I’ve truly read a single thing like that before.
    So great to find somebody with some genuine thoughts on this issue.
    Seriously.. thanks for starting this up. This site is something
    that is required on the internet, someone with some originality!

    Comment by Nelson — June 30, 2013 @ 11:03 pm

  26. It’s actually very difficult in this active life to listen news on Television, therefore I simply use world wide web for that purpose, and take the latest information.

    Comment by http://www.nexopia.com/users/lupepisces0/blog/1-dvd-format-pilate-classes — July 16, 2013 @ 9:36 pm

  27. Nice post. I used to be checking continuously this weblog and
    I am inspired! Extremely helpful information
    specially the ultimate part 🙂 I take care of such information
    a lot. I was seeking this particular info for a very lengthy time.
    Thanks and best of luck.

    Comment by loan modification — July 30, 2013 @ 11:32 pm

  28. constantly i used to read smaller articles or reviews
    that as well clear their motive, and that is also happening with this post which I am reading at this

    Comment by Urbanities - gift someone you love — September 26, 2013 @ 8:04 pm

  29. Admiring the persistence you put into your website and
    detailed information you provide. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed material.
    Fantastic read! I’ve bookmarked your site and I’m including your
    RSS feeds to my Google account.

    Comment by Urbanities - gift someone you love — September 26, 2013 @ 8:54 pm

  30. you’re in point of fact a just right webmaster. The web
    site loading pace is incredible. It sort of feels that you’re doing
    any unique trick. Also, The contents are masterwork.
    you have done a fantastic process in this topic!

    Comment by pets for sale in uae — June 27, 2014 @ 5:26 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: