PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<Functie naslagapache_child_terminate>
view the version of this page
Last updated: Tue, 22 Apr 2003

I. Apache-specifieke functies

Deze functies zijn alleen beschikbaar als PHP als een Apache module draait.

Inhoudsopgave
apache_child_terminate -- Be�indig het apache process na dit request
apache_lookup_uri --  Doet een gedeeltelijk aanvraag met de gespecificeerde URI en geeft informatie over deze URI terug
apache_note -- Get en set apache request notes
apache_request_headers -- Vraag alle HTTP request headers op
apache_response_headers -- Haalt alle HTTP response headers op
apache_setenv -- Stel een Apache subprocess_env variable in
ascii2ebcdic -- Vertaalt een string van ASCII naar EBCDIC
abcdic2ascii -- Vertaalt een string van EBCDIC naar ASCII
getallheaders -- Vraag alle HTTP request headers op
virtual -- Voer een Apache sub-request uit


User Contributed Notes
Apache-specifieke functies
add a note add a note
jarl at diku dot dk
25-Mar-2000 10:12

Many of the environment variables can be found here:

cjm2 at earthling dot net
10-Jan-2002 10:40

If you are trying to find a Handler to use with apache's mod_mime functions (e.g. SetHandler).  Use the MIME type associated with php.

e.g. SetHandler application/x-httpd-php

henk_nicolai at REMOVE-THIS at hotmail dot com
20-Nov-2002 11:03

My Apache server has a problem when someone enters a URI like: ". (Note the extra slash.) The server executes the index.php script anyway, which causes the browser directory and the current directory used in the script to be different. And therefore my relative links don't work, and my stylesheet is not loaded. A quick test (") reveals that also this site has this glitch.

When a client requests a directory without the last slash (") the server sends a HTTP 301 (Moved Permanently) response with a redirect to the correct URI ("), and my idea was to do the same when the user adds a slash too much:

<?php
  $req = $_SERVER['REQUEST_URI'];
  // Remove rubbish.
  $newReq = ereg_replace ('index.php[^?]*', 'index.php', $req);
  if (strlen($newReq) < strlen($req)) {
    header ('Location: '.$newReq);
    header ('HTTP/1.0 301 Moved Permanently');
    die;  // Don't send any more output.
  }
  unset($req); unset($newReq);

  ... (rest of the script) ...
?>

Replace every occurence of 'index.php' with your filename and you're done. Hope it helps. :-)

(Note: I'm not using fragments in my URI's (like 'index.php#bottom'), and this code may not do what you want if you are using them.)

crikou at xsilence dot net
12-Apr-2003 11:11

In reply to henk_nicolai, who is talking about the annoying apache behaviour.
First, thanks for your help nicolai.
I've been testing your script, but finally decide to use this one :

if (strstr(strstr($_SERVER['REQUEST_URI'],".php"), "/")) {
header ('Location: ' .$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
exit();
}

As apache is working on the first ".php" extension it finds, any slashes found after the extension is not welcome, and shouldnt be there (except if you have already implemented a / parser for beautiful urls)
So I guess this little code always works

Hope this helps !

Dhananjay Rokde dhanu1000 at indiatimes dot com
14-Apr-2003 11:29

######################################
#   Configuring Apache for Windows   #
######################################
CAUTION::
1) Read the tutorial completly and only then proceed.
2) BackUp the original Httpd.conf file.

First; install PHP.

Now, you will unzip the constance of that 5meg file you downloaded. Now create a folder in C:\Apache2 <ie: the Apache directory> and call it PHP. Now move the constance of the ziped file to that folder. Now go to your httpd.conf file. It is in your C:\apache2\conf directory.

Now open that sucker up with notepad. Be sure to do not add the files in ( )'s

First find the line:

Setting up Httpd.conf

ScriptAlias /cgi-bin/ "C:/Apache2/cgi-bin/"

Go to the line under it and insert:

ScriptAlias /php/ "C:/apache2/php/"
(what this does is tell the server where the php folder is)

Now find the lines:

# Format: Action handler-name /cgi-script/location

#
Go to the line following it and insert this:
Action application/x-httpd-php /php/php.exe
(What this does is tell the server where the php program is)

Now find the lines:

# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types

#
AddType application/x-tar .tgz
Go to the line following it and insert these lines:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
(what this does is like the extensions on files)

Now, look for

<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
Now add this below:
<IfModule mod_dir.c>
DirectoryIndex index.html index.php default.php main.php
</IfModule>

(What that does is when you go to a folder, it will go to one of thoes files)

#There is not too much of risk involved as you can always reinstall the apache software, so take it easy#

Apache is easily available at:

     <Entire List of Mirrors>

add a note add a note

<Functie naslagapache_child_terminate>
 Last updated: Tue, 22 Apr 2003
show source | credits | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: /
Last updated: Sat May 24 21:09:36 2003 CEST