php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22313 PHP scripts don't get params from query string
Submitted: 2003-02-19 20:09 UTC Modified: 2003-02-20 08:34 UTC
From: J dot M dot Benitez at Computer dot org Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.1 OS: Linux 2.4.19+
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: J dot M dot Benitez at Computer dot org
New email:
PHP Version: OS:

 

 [2003-02-19 20:09 UTC] J dot M dot Benitez at Computer dot org
Dear all, 
 
I've got apache 2.0.44 running under Linux Red Hat 8.0 
(kernel 2.4.19). This was an upgraded from Red Hat 7.3 
installation, which also implied an update of PHP. Most 
web applications are operative in the new environment, 
except those developed with PHP. 
 
Our main problem is that php scripts don't get the params 
passed through the query string, namely, if test.php is: 
---- 
<?php 
  print "<HTML>\n<HEAD>\n<TITLE>Test 
page</TITLE></HEAD>Testing for params readi 
ng<P>"; 
  print "Param: $param<BR>"; 
  print "\n</HTML>"; 
?> 
---- 
The output for http://myhost.domain/test.php?param=3 
should be something like: 
---- 
Param: 3 
---- 
Unfortunately, only "Param: " is produced. It doesn't 
matter which param value you pass, the script never sees 
it.  
 
I've checked this isn't a general problem for the web 
server, because, cgi scripts written in perl or python 
works perfectly, that is, they DO get params form query 
string ok. 
 
I have tried with different versions of PHP starting with 
4.2.2 as delivered with RH 8.0 and other updates: 4.3.0 
and the fresh 4.3.1. 
 
All of then suffer from the same issue. I'm not absolutely 
sure this is a php bug, but it seems as the most plausible 
reason. 
 
Any hints toward this? Any similar experiences? 
 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-19 21:43 UTC] sniper@php.net
What does this output: 

<?php var_dump($_GET); ?>

And how did you setup PHP within httpd.conf ?

 [2003-02-20 04:46 UTC] J dot M dot Benitez at Computer dot org
The output for:
<?php var_dump($_GET); ?>
is
array(1) { ["param"]=> string(1) "3" }

And how did you setup PHP within httpd.conf ?
The following is php.conf at /etc/httpd/conf.d, which is include'd in httpd.conf
-------
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    LimitRequestBody 524288
</Files>

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
------

These lines are also added to httpd.conf:
----
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .phtml
----
 [2003-02-20 07:25 UTC] sniper@php.net
In PHP 4.2.0, the 'register_globals' setting default changed to
'off'. See http://www.php.net/release_4_2_0.php for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.

.

 [2003-02-20 08:24 UTC] J dot M dot Benitez at Computer dot org
Thanks for the hint!

All right, by changing the setting of 'register_globals' to "On" everything works as expected.

Trying to comply with your efforts to make PHP scripting more secure and portable, I'm using $_GET to get query string params within scripts.

Thanks again!

With this I set the bug report as "Closed".
 [2003-02-20 08:27 UTC] sniper@php.net
Please leave this as 'Bogus' since this really wasn't
any bug. :)

 [2003-02-20 08:34 UTC] J dot M dot Benitez at Computer dot org
OK. So let it remain as "Bogus".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 14:01:29 2024 UTC