Another way to have the system recognize a PHP file as the index page 
is simply to edit the .htaccess file in that (or any overarching) 
directory so that '.html' files are parsed by PHP.  In default mode 
the PHP parser only does it's magic on files ending '.php', but you 
can force it to parse '.html' files as well.  I've done this in 
situations where I DON'T have access to the httpd.conf file.

Create (or edit) a .htaccess file in the directory you're interested 
in, or the base directory for the website.  It needs this line:

AddType application/x-httpd-php .php .html .htm

(and yes, you could do this overall using the AddType directives in httpd.conf)

Now you can still have the file 'index.html' and ALSO have PHP 
commands inside it.

----

I'd also like to set up other directories to run executables - I am 
developing several sites and prefer to keep them all separate. 
Haven't done it yet, but I'm guessing that adding a line in the 
httpd.conf file like

    ScriptAlias /cgi-bin/ "/User/username/cgi-bin"

would do it.

Nelson


>  >> >I managed to get Apache up and running and I edited the config file
>  >> >to recognize my Sites file as http://localhost/~username

[snip]

>To get php as a directory index you need to open up /etc/httpd/httpd.conf
>and find the line that says directory index. Do a search for index.html and
>it'll take you to the proper line. Add index.php (or whatever you want to
>call it) to that line and exit the editor. Type 'apachectl restart' and
>there you go.
>
>You should automatically have your CGI-Executables directory set up to be
>your cgi-bin. That is, you don't need to do anything other than direct your
>browser to http://127.0.0.1/cgi-bin/nameofcgi.cgi to get it to work. You
>need to make sure that your permissions are correct (chmod 755
>nameofcgi.cgi) to get them to be accessible. Hope that helps.


-- 

=============================================
Nelson Goforth                          Lighting for Moving Pictures
phone: 01.303.322.5042               pager: 01.303.634.9733
    resume: http://www.earthnet.net/~ngoforth/film

Reply via email to