Results 1 to 6 of 6

Thread: Can't open PHP files in Firefox (Apache installed)

  1. #1
    Join Date
    Jun 2006
    Beans
    553
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Can't open PHP files in Firefox (Apache installed)

    I've got the entire LAMP configuration installed, and this used to work. Apparently it doesn't anymore.

    I threw my project in /var/www/folder-name, and the permissions should be set correctly (I made everything in there, including the folder, 777 to check).

    I navigate to localhost, and I see "Index of /" with "Apache/2.2.8 (Ubuntu) Server at localhost Port 80" along the bottom. I see the folder. When I click on the folder, Firefox pops up with:

    You have chosen to open:

    which is a PHTML file.
    What would you like to do?
    (yeah, the name is blank)

    If I navigate directly to localhost/folder-name/index.php, it gives me a similar message:

    You have chosen to open:
    index.php
    which is a PHP file.
    I restarted Apache (sudo /etc/init.d/apache2 restart) and it seems to be working fine (otherwise it wouldn't even give me the index page, right?).

    What else should I check to see if everything is working properly?
    Laptop ==> Dell Mini 9 :: 2GB RAM :: Ubuntu Netbook Remix Jaunty

    Desktop ==> Shuttle SG31G2 V2 :: Primarily Media Center (XBMC)

  2. #2
    Join Date
    Jun 2006
    Location
    North Carolina, USA
    Beans
    784
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Can't open PHP files in Firefox (Apache installed)

    Did you try clearing your browser cache after restarting apache? I doubt it will make a difference but worth a try. I have seen someone say this fixed there problem with this before.

  3. #3
    Join Date
    Oct 2006
    Location
    Eagan, MN
    Beans
    113

    Re: Can't open PHP files in Firefox (Apache installed)

    look like your Apache doesn't know how to handle .php file. You can try to reinstall libapache2-mod-php5 package again, see if it can reset the configuration of Apache.

    The permission seems to be OK.

  4. #4
    Join Date
    Aug 2008
    Beans
    787
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Can't open PHP files in Firefox (Apache installed)

    I had once this problem too and after I restarted apache everything works like a charm.
    *NIX makes business nowadays.

  5. #5
    Join Date
    Nov 2008
    Beans
    4

    Re: Can't open PHP files in Firefox (Apache installed)

    Clearing the cache worked for me. I had messed with my php.ini file in lampp, and then had this problem with opening a phtml file. Neither restarting lampp nor rebooting helped. Clearing Firefox's cache did the trick.

  6. #6
    Join Date
    Oct 2010
    Location
    Bangalore, India
    Beans
    37
    Distro
    Ubuntu 16.04 Xenial Xerus

    Talking Re: Can't open PHP files in Firefox (Apache installed)

    Wow, this is weird, but its true. Restarting the cache in firefox did the trick for me. Glad i found this post or im sure i would have stayed up trying to fix this one.

Tags for this Thread

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
  •