Multiple instances of the same PHP project using classes from the wrong directory

57 Views Asked by At

We have a web server with 4 vhosts of the same project (for different countries).

Our setup is Apache24 with PHP-FPM running 5.6. We use the composer autoloader with our classes directory following the PSR-0 autoloading standard. The composer autoloader is committed to the repository and the autoload_classmap.php doesn't contain any paths at all.

Directory structure

/var/www/website.co.uk
/var/www/website.co.nz
/var/www/website.ca
...

Project structure

public_html/
--/controls
--/classes
--index.php

When we serve files from any of the hosts, it will always use classes from the website.co.nz folder however when we call any other file such as a "control" it is served from the correct path.

We have already disabled Zend Opcache, however Xcache is still enabled. I can't find any reasonable documentation for Xcache which will tell me whether or not I can disable it.

The website.co.nz was deployed first, I'm unsure of this is of any value but worth mentioning.

Classmap file:

<?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
0

There are 0 best solutions below