Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Regarding my particular APC setup:

APC 3.1.9
Apache 2.2.15
CentOS 6.3

I would like to keep only one copy of apc.php that can be accessed via any of the vhosts on the server. What's the recommended way to do this?

It seems that apc.php doesn't play well with apache Alias directive. apc.php only exists is on one of the vhosts, is set to 644 and it doesn't seem to matter who owns it: if I try to access it via an alias I get only gibberish:
enter image description here

Do I really need to use a symbolic link for this purpose or can I make an Apache alias work?

share|improve this question
That's not gibberish, it's code from something. – Chris S Nov 8 '12 at 21:28
That's a copy of apc.php. It's clearly not being interpreted as a PHP script, but just being sent directly to the browser. – Michael Hampton Nov 9 '12 at 0:07

apc is being displayed rather than interpreted. The vhost it resides on is probably not configured to interpret PHP files.

Fix your vhost configuration (make sure the PHP module is loaded or the CGI is configured, and the appropriate AddType directive for PHP files has been added to your Apache configuration.
(Instructions on how to do both of these items can be found in the PHP documentation.)

share|improve this answer
That was my initial suspicion, but both the real apc.php and the alias are in a vhost that runs PHP. Unless there is something else I need to do to enable PHP in an aliased directory? – Gaia Nov 9 '12 at 13:12
@Gaia There should be nothing special to make PHP work under an aliased directory (I have such an arrangement on one of my systems and it works fine) -- the only reason I could think of for it to not work is a missing LoadModule directive or a missing/incorrect AddType directive (cf. this SO question). I don't suppose there's anything interesting in your logs (since the server is probably returning 200/OK - here's your PHP file)? – voretaq7 Nov 9 '12 at 16:34
Nothing in the logs. Both files process PHP fine (they both run wordpress). httpd -M shows alias_module (shared). Adding Allow from All didnt help. Having or not trailing slashes both in the TO and FROM of the alias directive didn't help. – Gaia Nov 9 '12 at 20:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.