Results 1 to 7 of 7

Thread: [desktop] PHP scripts don't run, but get downloaded.

  1. #1
    Join Date
    Apr 2010
    Location
    Canada
    Beans
    188
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Red face [desktop] PHP scripts don't run, but get downloaded.

    I can't get PHP to work properly with my apache2 server.

    I've tried adding this to the empty httpd.conf file:
    Code:
    AddType application/x-httpd-php .php3 .php
    AddType application/x-httpd-php-source .phps
    but that didn't work. Also, there are no apparent php related files in /etc/apache2/mods-enabled

    Any ideas?
    If something is not broken, fix it! Modfy every bit of it you can! Break it! This is how improvement and real education happens.

  2. #2
    Join Date
    Feb 2006
    Location
    Ontario, Canada
    Beans
    49
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [desktop] PHP scripts don't run, but get downloaded.

    I had this problem a short while ago. I never figured out precisely what the problem was but it had to do with web sites served from a user's home directory, e.g., /home/user/public_html/. I put the files under /var/www and the problem went away.

    - Dennis

  3. #3
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,741

    Re: [desktop] PHP scripts don't run, but get downloaded.

    Did you install the fill LAMP stack?

    Code:
    sudo tasksel
    and select LAMP

  4. #4
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: [desktop] PHP scripts don't run, but get downloaded.

    Remove anything you added to httpd.conf, then make sure apache's php5 module is installed and enabled.
    Code:
    sudo apt-get install libapache2-mod-php5
    sudo a2enmod php5
    sudo /etc/init.d/apache2 restart

  5. #5
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: [desktop] PHP scripts don't run, but get downloaded.

    Sorry, the site gave me a proxy error, so I didn't think my post went through.
    Last edited by cdenley; August 5th, 2010 at 02:25 PM. Reason: double post

  6. #6
    Join Date
    Apr 2010
    Location
    Canada
    Beans
    188
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [desktop] PHP scripts don't run, but get downloaded.

    Dennis:
    My files are already under /var/www so that wont work.

    Vagen:
    I tried that, but it still doesn't work.

    cdenly:
    "libapache2-mod-php5 is already the newest version." is what I get when install it, and then at the same time:

    Code:
    eric@eric-desktop:~$ sudo a2enmod php5
    ERROR: Module php5 does not exist!
    So at this point I don't know what to do. I'll try reinstalling "libapache2-mod-php5".
    If something is not broken, fix it! Modfy every bit of it you can! Break it! This is how improvement and real education happens.

  7. #7
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: [desktop] PHP scripts don't run, but get downloaded.

    Code:
    ls -l /etc/apache2/mods-available/php5.*
    dpkg-query -S php5.*

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •