Results 1 to 2 of 2

Thread: PHP - open in firefox: localhost...?

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Location
    Southeast Missouri
    Beans
    4
    Distro
    Ubuntu 9.10 Karmic Koala

    PHP - open in firefox: localhost...?

    I'm running Ubuntu 11.04 and have LAMP installed. I store my PHP files at.... var/www/php
    When I open a file with Firefox, it will open like this... file:///var/www/PHP/test.php -- (which does not work).

    If I change the address to... localhost/PHP/test.php
    It will render the PHP code just fine. Is there a way to tell the files in var/www to open starting with localhost/?

    I'm pretty new to this so any help will be appreciated. Mark

  2. #2
    Join Date
    Apr 2005
    Location
    Finland/UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: PHP - open in firefox: localhost...?

    Quote Originally Posted by dmsherrill View Post
    I'm running Ubuntu 11.04 and have LAMP installed. I store my PHP files at.... var/www/php
    When I open a file with Firefox, it will open like this... file:///var/www/PHP/test.php -- (which does not work).

    If I change the address to... localhost/PHP/test.php
    It will render the PHP code just fine. Is there a way to tell the files in var/www to open starting with localhost/?

    I'm pretty new to this so any help will be appreciated. Mark
    The only way you can open PHP files is through the web server (by using http://localhost as the address in your web browser).

    The server can't be used to open, or execute random files by clicking on them in file manager or anything like that, it has pretty strict configuration about what files and directories it's supposed to use, and it really isn't even made to work for local users opening files from a file manager.

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
  •