3

Regarding my particular APC setup:

APC 3.1.9
PHP 5.3.3/fCGI/SuEXEC
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?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Gaia
  • 1,855
  • 5
  • 34
  • 60

1 Answers1

3

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.)

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • 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 09 '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](http://stackoverflow.com/questions/9133902/apache-alias-directive)). 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 09 '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 09 '12 at 20:06