|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
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.