0

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(
);
Adam Copley
  • 1,495
  • 1
  • 13
  • 31
  • do you have separate vendor folders for each project? – delboy1978uk Apr 20 '18 at 13:59
  • there is a vendor directory within each of the sites folders. However composer dump-autoload isn't run on the server, it is run before we commit files to the repository. However, this shouldn't matter as this is done on our local systems, which doesn't have a similar path to the one being served – Adam Copley Apr 20 '18 at 14:10
  • how is the vendor folder deployed? installed on a non-prod server, and copied over? if so you should get the autoload files. if still no, check each projects require_once for the autoload and make sure they aren't pointoing to the same one – delboy1978uk Apr 20 '18 at 14:24
  • They use relative paths in the require_once, and it's not done on a non-prod or clone-setup server, it's just generated locally, where the actual path will be completely different to any of the hosts on the prod server – Adam Copley Apr 20 '18 at 14:30
  • if it's generated locally, i take it the autoload classmap file is populated? do you then copy this to prod etc? – delboy1978uk Apr 20 '18 at 14:31
  • The classmap file doesn't have any classes in the last, and yes it is copied in its "blank" form – Adam Copley Apr 20 '18 at 14:32

0 Answers0