Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: [SOLVED] PHP prompts to save - Apache2

  1. #1
    Join Date
    Aug 2008
    Location
    UK
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    [SOLVED] PHP prompts to save - Apache2

    A few things:
    1. This is my first attempt at running a webserver
    2. I've googled this problem for nearly 3 hours (today, and many more yesterday), and found lots on the subject, but nothing that helped.

    I've managed to install apache2, php5 and mysql on ubuntu. Normal html pages are served properly, but php pages prompt to save rather than run.

    I've followed the instructions from here:

    https://help.ubuntu.com/community/Ap...Using%20Apache

    including the "if php doesnt work" bit but the situation doesn't change.

    I'm guessing its a config problem somewhere but have no idea where to start.
    Last edited by myth01; October 9th, 2008 at 10:36 PM. Reason: my terrible lazy english

  2. #2
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: PHP prompts to save - Apache2

    Usually when you have a problem like that it is an ownership or permissions issue. Any file located in /var/www should only be owned by root or www-data and have permissions of 755.

    Jim

  3. #3
    Join Date
    Sep 2007
    Location
    North Ft. Myers, FL USA
    Beans
    477
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: PHP prompts to save - Apache2

    This is how I got my server to work. http://ubuntuforums.org/showthread.php?t=844409

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

    Re: PHP prompts to save - Apache2

    So you did all this?
    Code:
    sudo apt-get install libapache2-mod-php5
    sudo a2enmod php5
    sudo /etc/init.d/apache2 restart
    What do the logs show after a request for a php script?
    Code:
    tail /var/log/apache2/error.log
    tail /var/log/apache2/access.log

  5. #5
    Join Date
    Aug 2008
    Location
    UK
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP prompts to save - Apache2

    cheers guys for your replies.

    in /var/www i did this:

    Code:
    sudo chown root:root test.php
    and cleared my browser cache, tried test.php (the phpinfo test page) again and it is still prompting to save.

    aah!

  6. #6
    Join Date
    Aug 2008
    Location
    UK
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP prompts to save - Apache2

    cdenley:

    at the terminal i did:

    sudo aptitude install apache2 php5-mysql libapache2-mod-php5 mysql-server

    ill check the logs now....

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

    Re: PHP prompts to save - Apache2

    Quote Originally Posted by myth01 View Post
    cdenley:

    at the terminal i did:

    sudo aptitude install apache2 php5-mysql libapache2-mod-php5 mysql-server

    ill check the logs now....
    In addition to the other commands I posted, correct?

  8. #8
    Join Date
    Aug 2008
    Location
    UK
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP prompts to save - Apache2

    oops, sorry, yep, a2enmod php5 returned 'This module is already enabled' and I restarted apache.

    the last entry in errors.log was nearly 2 hours ago, and access.log shows:

    127.0.0.1 - - [09/Oct/2008:22:20:49 +0100] "POST /submit.php HTTP/1.1" 200 931 "http://localhost/form.html" "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.3) Gecko/2008092510 Ubuntu/8.04 (hardy) Firefox/3.0.3"
    127.0.0.1 - - [09/Oct/2008:22:26:47 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.8 (Ubuntu) (internal dummy connection)"
    127.0.0.1 - - [09/Oct/2008:22:26:47 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.8 (Ubuntu) (internal dummy connection)"
    127.0.0.1 - - [09/Oct/2008:22:26:47 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.8 (Ubuntu) (internal dummy connection)"
    127.0.0.1 - - [09/Oct/2008:22:26:47 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.8 (Ubuntu) (internal dummy connection)"
    127.0.0.1 - - [09/Oct/2008:22:26:47 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.8 (Ubuntu) (internal dummy connection)"
    127.0.0.1 - - [09/Oct/2008:22:26:47 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.8 (Ubuntu) (internal dummy connection)"

  9. #9
    Join Date
    Aug 2008
    Location
    UK
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP prompts to save - Apache2

    ...bump...

    please help! I do not have much hair left to pull out....

  10. #10
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: PHP prompts to save - Apache2

    Quote Originally Posted by myth01 View Post
    ...bump...

    please help! I do not have much hair left to pull out....
    If you've done all the necessary already posted it should work, can you try the following, on the off chance it will sort things out:

    Code:
    sudo /etc/init.d/apache2 force-reload
    Hope that helps

Page 1 of 2 12 LastLast

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
  •