on admin/reports/status/apc

i am getting 404-errors when clicking

- View Hosts Stats
- System Cache Enrties
- User Cache Entries
- Version Check

what could be the reason for that?

Comments

bfroehle’s picture

Can you give some more information:

- Webserver and PHP version?
- Where did you download the apc.php file?

bavarian’s picture

Apache version 2.2.22
PHP version 5.3.15
MySQL version 5.1.56
Architecture x86_64
Operating system linux (CENTOS 5.8)

dowloaded apc.php-file from
http://svn.php.net/viewvc/pecl/apc/trunk/apc.php?view=co

bfroehle’s picture

I've only personally tested this module on Drupal 6.x. The 7.x port was provided by some other kind folks who provided a few small patches from the 6.x source.

It sounds to me like all of your issues that you have reported likely have the same root cause.

Oddest, of course, is the authentication bug since this module specifically attempts to turn off authentication with: define('USE_AUTHENTICATION', 0);

You are accessing the APC status page by visiting http://example.com/admin/reports/status/apc, right?

bfroehle’s picture

I've noticed that one of the first lines of the apc.php file you downloaded is:

if (file_exists("apc.conf.php")) include("apc.conf.php");

Any chance you have a "apc.conf.php" file someplace?

bavarian’s picture

I think I am on my way to discover what is causing the problems ... some of them at least

404-errors for
- View Hosts Stats
- System Cache Enrties
- User Cache Entries
- Version Check

the URLs behind the buttons look like
http://example.com/ADMIN/blablablabbla/yadyadd/something

BUT i am making use of this module called
http://drupal.org/project/rename_admin_paths

which changes the ADMINpath to something else, lets say SECADMIN

all my admin-urls start with SECADMIN after the hostname http://example.com/SECADMIN/blabla/yadayada .....

when in http://example.com/SECADMIN/reports/status/apc
and click the links mentioned above i get 404-errors
BUT when I exchange ADMIN with SECADMIN the links take me to desired reports

so far for the 404-errors. I guess I should try patching the necessary files ... but with my limited php-experience, i wait a while

can't tell if the people behind the APC Status module or the people behind the Rename Admin Path module might want to make changes ...

i would guess this path -issue is also the reason why the diagrams are not showing up in APC Status on my end

bavarian’s picture

from what I can see now:

the HTML-code producing the image in the apc.php.inc-file is

src=\"$PHP_SELF?IMG=1&$time\"

there's also code in the pac.php.inc-file

// rewrite $PHP_SELF to block XSS attacks
//
$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],''), ENT_QUOTES, 'UTF-8') : '';
$time = time();
$host = php_uname('n');
if($host) { $host = '('.$host.')'; }
if (isset($_SERVER['SERVER_ADDR'])) {
  $host .= ' ('.$_SERVER['SERVER_ADDR'].')';
}

that takes SERVER['PHP_SELF'] and rewrites it. I guess that SERVER['PHP_SELF'] comes from the apc_status.admin.inc-file where this code is located

// Hacks to get the apc.php file working.
  define('USE_AUTHENTICATION', 0);
  $_SERVER['PHP_SELF'] = url('admin/reports/status/apc');
  global $MYREQUEST, $MY_SELF, $MY_SELF_WO_SORT, $AUTHENTICATED;
  global $time, $col_black;

here in apc_status.admin.inc-file i have tried to change

$_SERVER['PHP_SELF'] = url('admin/reports/status/apc');
into
$_SERVER['PHP_SELF'] = url('SECADMIN/reports/status/apc');
(the correct path)

but that does not seen to do the trick !

any help would be appreciated !

bfroehle’s picture

@bavarian: It sounds like you have a pretty non-standard installation, so I'm not sure how to continue to debug this.

As you suspect we probably aren't setting $_SERVER['PHP_SELF'] correctly for your situation, but I'm not sure what would be the correct behavior.

Please let me know if you make any progress.

bavarian’s picture

I don't have the knowledge to dig into this any deeper ...

maybe i could continue if anybody can tell me why my system does not accept changing

$_SERVER['PHP_SELF'] = url('admin/reports/status/apc');

into

$_SERVER['PHP_SELF'] = url('SECADMIN/reports/status/apc');

in the apc_status.admin.inc-file?