php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39077 PATH_INFO not available in PHP 5.2 win32
Submitted: 2006-10-07 14:15 UTC Modified: 2010-12-20 12:19 UTC
From: pcdinh at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.0RC5 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pcdinh at gmail dot com
New email:
PHP Version: OS:

 

 [2006-10-07 14:15 UTC] pcdinh at gmail dot com
Description:
------------
I would like to user $_SERVER['PATH_INFO'] in one of my search-engine friendly script but unfortunately, it is not available under Apache 2.2, PHP 5.2 RC5 installed as a module. PHP engine said: Undefined index: PATH_INFO

Reproduce code:
---------------
Sample code

index.php in mod_rewrite folder

<a href="http://localhost/mod_rewrite/forum/21/3.html">url</a>
<?php
var_dump($_SERVER['PATH_INFO']);
?>

.htaccess in mod_rewrite folder

AcceptPathInfo On
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^index.php(/.*) /index.php [E=PATH_INFO:$1,L]
RewriteRule ^(.*)/(.*)/(.*).html http://localhost/mod_rewrite/index.php?module=$1&cid=$2&topic=$3

=============================================
My environment
=========My PHP directives in httpd.conf of Apache 2.2.3

LoadModule php5_module "c:/server/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/server/php5"

<Directory "D:/webroot">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

    AcceptPathInfo On

</Directory>


=================My PHP.ini

extension=php_mbstring.dll
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll


;extension=php_apc.dll
;extension=php_memcache.dll
;extension=php_http.dll


extension=php_pdo.dll
extension=php_pdo_mysql.dll

;zend_extension_ts = "C:/server/php5/ext/php_xdebug.dll"

Expected result:
----------------
I expected that when I click on the link http://localhost/mod_rewrite/forum/21/3.html the value of PATH_INFO will be printed out from http://localhost/mod_rewrite/index.php because .htaccess should be routed the request to index.php.

Actual result:
--------------
The script has printed out: 

Notice: Undefined index: PATH_INFO in D:\webroot\mod_rewrite\index.php on line 3
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-07 14:22 UTC] pcdinh at gmail dot com
Sorry I have made a mistake. Just ignore it.
 [2010-12-20 12:19 UTC] jani@php.net
-Package: Tidy +Package: *General Issues
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 09:01:31 2025 UTC