|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-01-30 00:52 UTC] gizmo at aoaforums dot com
Description: ------------ I'm currently running a Gentoo server with the 2007.0 profile, and the hardened sources, on kernel 2.6.27-r13. I have PHP 5.2.8-r1 and Suhosin 0.9.27, with Apache 2.2.10 and MySQL 5.0.70-r1. I have installed 3.0.19 of APC, and two instances in completely different directories, of Joomla 1.5.8. Each Joomla instance has its own database. (All packages have been installed using Gentoo Portage, or PECL in the case of APC). When I have APC enabled, one of the Joomla instances will start using data from the other Joomla instance. It appears that when Joomla starts up, it is requesting the configuration.php file from its local directory, and actually getting the contents of the file from the OTHER directory. Turning APC off causes things to function normally. I haven't yet determined if the first site to get cached is the one that always gets returned, or if it is totally random. For what it's worth, I had the exact same problem with eAccelerator. The problem appears to only affect Joomla 1.5. Reproduce code: --------------- settings from /etc/apc.ini extension=apc.so apc.enabled="0" apc.shm_segments="6" apc.shm_size="16" apc.user_entries_hint="1024" apc.num_files_hint="1024" apc.ttl="1800" apc.user_ttl="1800" apc.gc_ttl="900" apc.cache_by_default="1" ;apc.filters="" ;apc.mmap_file_mask="/tmp/apcphp5.XXXXXX" apc.slam_defense="0" apc.file_update_protection="2" apc.enable_cli="0" apc.max_file_size="1M" apc.stat="1" apc.write_lock="1" apc.report_autofilter="0" apc.include_once_override="0" apc.rfc1867="0" apc.rfc1867_prefix="upload_" apc.rfc1867_name="APC_UPLOAD_PROGRESS" apc.rfc1867_freq="0" apc.localcache="0" apc.localcache.size="512" apc.coredump_unmap="0" Expected result: ---------------- Sites should not share scripts via the cache unexpectedly. Actual result: -------------- Sites appear to share some cached php scripts, with unexpected results. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 21:00:01 2025 UTC |
Please put up the apc.php that came with your apc install into the docroot and hit it. Possibly, joomla is using apc cache and both instances are hitting the cache with the same key. More like if(!($data = apc_fetch('foo'))) { include("foo.php"); } perhaps - please check for it. I'm pondering on a apc.vhost_mask feature to allow the same code to be run in different vhosts without issues.Some more information on this, if you want to pursue. I'm not sure if you want to consider this a bug or not, but it is certainly a situation where APC behaves differently from plain PHP. Save the following code in a web-accessible directory somewhere as e.g. /var/www/www.testserver.org/htdocs/cachetest.php: <?php echo dirname(__FILE__); ?> now, make a hardlink to this file from some other directory like so: ln cachetest.php /var/www/www.othertestserver.org/htdocs Hit the first file with a browser, and observe the output, which should be: /var/www/www.testserver.org/htdocs Now, hit the second file with the web browser, and observe the output, which WE EXPECT TO be: /var/www/www.othertestserver.org/htdocs In fact, however, the output will be identical to the output from the first file. Disable APC, and the output will be what we expect. With APC enabled, the output will be identical for both files, and will be determined by which file gets cached first.