Problem with "enabling" $_SERVER['PATH_INFO']

Hi all,

Can someone please tell me where exactly in httpd.conf i’m supposed to place AcceptPathInfo On for it to work? I’ve tried placing it within <Directory /> i.e.

<Directory />
Options FollowSymLinks
AllowOverride None
AcceptPathInfo On
</Directory>

I’ve tried placing it within the following:

<Directory “C:/Documents and Settings/…/My Documents/localhost”>

AcceptPathInfo On

</Directory>

and i’ve tried placing it in the “root” of httpd.conf. However $path = $_SERVER[‘PATH_INFO’]; generates the error Notice: Undefined index: PATH_INFO in C:\Documents and Settings\…\My Documents\localhost\path\filename.php on line 4

Any ideas? Thanks

mat,

http://httpd.apache.org/docs/2.0/mod/core.html#acceptpathinfo

Regards,

DK

Thanks for your reply but i’ve already read the relevant manual section and it doesn’t help. The manual gives an example of using AcceptPathInfo within the <Files> directive but based on what is then written about the <Files> directive it should only need to go in there if it’s going to apply only to certain files - which is not the case. Nonetheless, i’ve tried what you suffested:

<Files ~ “\.(php)$”>
AcceptPathInfo On
</Files>

and it still doesn’t work. Also, $SERVER_PATH[‘INFO’] doesn’t appear in the PHP configuration details shown by echo phpinfo(); The Apache and PHP versions are Apache/2.0.55 (Win32) PHP/5.1.1.

Any other ideas?

mat,

Well, that says that it can go in httpd.conf’s core, VirtualHost, and/or Directory sections OR in the .htaccess where it would apply to directories and/or files at that level and below.

$SERVER_PATH[‘INFO’] is not correct:

Finally, if that’s all you want (to include a filename in place of a directory name), then use Options -MultiViews (top of .htaccess) as it does the same thing. Search the Apache.org site and you’ll get http://httpd.apache.org/docs/1.3/content-negotiation.html as the first match.

Regards,

DK


<Directory />
Options FollowSymLinks
[b]AllowOverride None[/b]
AcceptPathInfo On
</Directory>

That’s why it doesn’t work. Look in the manual:


Description: Resources accept trailing pathname information
Syntax: AcceptPathInfo On|Off|Default
Default: AcceptPathInfo Default
Context: server config, virtual host, directory, .htaccess
[b]Override: FileInfo[/b]
Status: Core
Module: core
Compatibility: Available in Apache 2.0.30 and later

You need AllowOverride FileInfo at the very least to make it work.

Btw it will help you a lot if you spend some time reading how the Apache manual is structured (takes about 10 mins) because that project has one of the best documentations that I know of.

As for where AcceptPathInfo should be, I just whack it in httpd.conf/apache2.conf, not under any directory context.