Errors occurring on server

Silverstripe 3.7.3:

Im receiving the error:

"AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Exception: There are two files containing the "Foo" class: "/var/www/vhosts/example.com/httpdocs/framework/vendor/phpunit/php-code-coverage/tests/_files/source_with_ignore.php" and "/var/www/vhosts/example.com/httpdocs/framework/vendor/**phpunit**/php-code-coverage/tests/_files/source_with_oneline_annotations.php" in /var/www/vhosts/example.com/httpdocs/framework/core/manifest/ClassManifest.php:568\nStack trace:\n#0 /var/www/vhosts/example.com/httpdocs/framework/filesystem/FileFinder.php(157): SS_ClassManifest->handleFile('source_with_one...', '/var/www/vhosts...', 6)\n#1 /var/www/vhosts/example.com/httpdocs/framework/core/manifest/ClassManifest.php(338): SS_FileFinder->find('/var/www/vhosts...')\n#2 /var/www/vhosts/example.com/httpdocs/framework/core/manifest/ClassManifest.php(162): SS_ClassManifest->regenerate(true)\n#3 /var/www/vhosts/example.com/httpdocs/framework/core/Core.php(103): SS_ClassManifest-...'" 

When trying to build, dev/build?flush=1, this isn’t an issue on my dev server.
Is there a configuration in php Strict, etc that would enable this to function as it does on the dev server,

    Live Server Ubuntu 18.04, PHP 7.2 (Also tried 7.3 same issue occurs)
    Dev Server Ubuntu 18.04, PHP 7.2

The config between the two machines is not the same, one is an install from iso/download the other is a cloud install with Plesk Obsidian running.

Or if not where would I best start trying to solve this issue?

// Include any relevant code. If you have a lot of code, link to a gist instead.

Have a look at the directories shown in the error message. It’s saying that the same class is in two different files, so if they’re both present, then that’s why. You’ll need to remove one of them. Was this an upgrade or an existing site?

If they’re not both there, you might have a caching issue somewhere. If you have a silverstripe-cache directory in the web root, empty it. If you don’t have one, create it and try the dev/build?flush again.

Blockquote
Have a look at the directories shown in the error message. It’s saying that the same class is in two different files, so if they’re both present, then that’s why. You’ll need to remove one of them. Was this an upgrade or an existing site?

The classes do most definitely exist in both locations, however there are a number more within the phpunit module that will do the same. I’m not sure of the purpose of the class (testing?) however the Dev copy has the same files are runs without any issue. I’ve tried renaming the classes in the folders and it simply shuffles the issue further down the conflicting definitions. In short I don’t believe this is the issue. If I remove the module /framework/vendor/phpunit - there is also an error with Reflection being shown, even though the class being copied does exist.
$classRef = new ReflectionClass($class);

I’m wondering whether there is a php module missing on the server, or a configuration setting that allows the php to run in a different capacity. I’ve added the silverstripe-cache folder, it is getting populated with some classes but the error remains the same.

Actually, the new server has a composer extension to build the scripts (Plesk+PHP Composer), I removed all composer added modules and then reuploaded the source - the servers composer extension then registered a much longer list, and appears to now be working. So is a reference issue. But also adds the composer files to above the root directory - so configured differently to the dev copy.

This was the same issue as my other post, open short tags was disabled in PHP, so some classes where not loading. Once enabled everything worked as expected. The Duplicate classes did exist however in this context did not cause any issues once the config was correct.