php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37012 ini_get('cgi.fix_pathinfo') broken
Submitted: 2006-04-07 18:15 UTC Modified: 2006-04-10 21:57 UTC
From: ms419 at freezone dot co dot uk Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.4.2 OS: Debian
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: ms419 at freezone dot co dot uk
New email:
PHP Version: OS:

 

 [2006-04-07 18:15 UTC] ms419 at freezone dot co dot uk
Description:
------------
ini_get('cgi.fix_pathinfo') is broken

I can tell from my php.ini & from the behavior of PHP that cgi.fix_pathinfo=1

However -


fis% /usr/lib/cgi-bin/php4
<?php
var_dump(ini_get('cgi.fix_pathinfo'));
?>
X-Powered-By: PHP/4.4.2-1+b1
Content-type: text/html

string(0) ""
fis% 


Thanks - Jack


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-07 18:26 UTC] tony2001@php.net
Make sure this particular PHP executable uses the same php.ini file.
Hint: `php -i | grep php.ini`
 [2006-04-07 18:37 UTC] scottmacvicar at ntlworld dot com
ini_get only works on items that have STD_PHP_INI_ entries, unfortunately the cgi module does not have that entry so you can't use ini_get.

The only other solution is get_cfg_var

------------
test1 ~ # fgrep "cgi.fix_pathinfo" /etc/php/cgi-php5/php.ini
cgi.fix_pathinfo = 1

test1 ~ # php-cgi
<? var_dump(ini_get("cgi.fix_pathinfo")); ?>
X-Powered-By: PHP/5.1.2-gentoo
Content-type: text/html

string(0) ""

test1 gentoo-php-overlay # php-cgi
<? var_dump(get_cfg_var("cgi.fix_pathinfo")); ?>
X-Powered-By: PHP/5.1.2-gentoo
Content-type: text/html

string(1) "1"
------------
 [2006-04-07 20:28 UTC] ms419 at freezone dot co dot uk
Thanks tony2001 & scottmacvicar

The PHP executable was using the correct php.ini file

Thanks very much for the information on STD_PHP_INI_ entries

get_cfg_var is a suitable workaround

Thanks again - Jack
 [2006-04-10 21:57 UTC] sniper@php.net
This is intentional. Not a bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 06:01:36 2025 UTC