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?

2
  • 1
    That's not gibberish, it's code from something.
    – Chris S
    Nov 8, 2012 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. Nov 9, 2012 at 0:07

1 Answer 1

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

3
  • 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, 2012 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, 2012 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, 2012 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .