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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC