php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35706 Constants defined even when they are no randomly
Submitted: 2005-12-16 11:31 UTC Modified: 2005-12-24 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: andy at mandlnet dot co dot uk Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.4.1 OS: Linux
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: andy at mandlnet dot co dot uk
New email:
PHP Version: OS:

 

 [2005-12-16 11:31 UTC] andy at mandlnet dot co dot uk
Description:
------------
Defined constants appear to carry over occasionally between sites on the same server. We have downgraded to PHP 4.3.10 now and this has fixed the problem.

Reproduce code:
---------------
<?php
foreach(get_defined_constants() as $key => $value) {
  printf("%s = ", $key);
  var_dump($value);
}
?>

Expected result:
----------------
Sometimes you will get just a normal result, if you have a site on the same server that uses defined constants sometimes they appear at the bottom.
It should display all defined constants from 
E_ERROR = int(1) to GD_BUNDLED = int(0) as no others have been defined in our script.

Actual result:
--------------
Occasionally we got :
CMS_VERSION_MAJ = int(4) CMS_VERSION_MIN = int(0) CMS_VERSION_INC = int(3) CMS_VERSION = string(5) "4.0.3" CMS_CONFIG_SITENAME = string(11) "<deleted>" CMS_CONFIG_CHIEF_EMAIL = string(21) "<deleted>" CMS_CONFIG_ADMIN_CLIENTHELPCONTACT = string(58) "<deleted>" 

as well as constants defined for database conectivity. (username and password) from other virtual hosts on the same server.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-16 11:41 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-12-16 16:28 UTC] andy at mandlnet dot co dot uk
I have now downgraded to 4.3.10 so can not provide you with a URL for examples however, If you create a new virtual host and a script containing the following:
<?php
define('CMS_CONFIG_MYSQL_HOST','localhost');
define('CMS_CONFIG_MYSQL_USERNAME','username');
define('CMS_CONFIG_MYSQL_PASSWORD','password');
define('CMS_CONFIG_MYSQL_DATABASENAME','databasename');
echo "Constants Defined";
?>
Visit this site and then using a different virtual server on the same physical server use the script posted earlier to display all constants.
You may have to reload each page a few times before the constants are displayed, but it does eventually.
 [2005-12-16 16:34 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2005-12-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC