SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Jul 2001
    Location
    New Zealand
    Posts
    340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    code doesnt execute?

    Hi guys, i set apache (1.3) up with php (latest), and when I try to execute a php file, it opens download prompt, and downloades the code!

    If i open root (ie http://localhost/) with a index.html file in root, it will execute the html file, but replacing index.html with index.php it will show the whole folder
    ie:
    Index of /
    Name Last modified Size Description
    --------------------------------------------------------------------------------
    Parent Directory 06-Nov-2002 15:45 -
    admin.html 01-Jun-2001 02:21 1k
    index.php 26-Dec-2001 13:11 1k

    any help would be very much appreciated!

  2. #2
    SitePoint Addict
    Join Date
    Jul 2001
    Location
    New Zealand
    Posts
    340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind, i reinstalled and got php working now!

    just wondering how can i make php execute index.php when i request http://localhost/ ?

  3. #3
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit your httpd.conf ( apache configuration file ) file,
    you will find
    <IfModule mod_dir.c>
    DirectoryIndex index.html
    </IfModule>

    edit that as

    <IfModule mod_dir.c>
    DirectoryIndex index.html index.php
    </IfModule>

    the order is from left to right,
    so if index.html and index.php exist in the same directory then index.html will take precedence.
    Eventually invert the order to fit your needs.



    pippo
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  4. #4
    SitePoint Addict
    Join Date
    Jul 2001
    Location
    New Zealand
    Posts
    340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thankyou very much for your help pippo!!!

    i dont think i would have found that by myself


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
  •