So.. Ive been building an application with Symfony3 framework for my bachelor project and it works flawless on localhost. Both in dev-environment and prod.
However. When Im trying to deploy it to a Heroku App im getting the following log..
Generating optimized autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Fatal error: Uncaught Error: Class 'Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle' not found in /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/app/AppKernel.php:15
Stack trace:
#0 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(396): AppKernel->registerBundles()
#1 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(114): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#3 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(118): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvI in /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/app/AppKernel.php on line 15
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Uncaught Error: Class 'Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle' not found in /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/app/AppKernel.php:15
Stack trace:
#0 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(396): AppKernel->registerBundles()
#1 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(114): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#3 /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(118): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvI in /tmp/build_68991520ff4642cdf86248159a2f0f54/Carante-getmoving-585074f/app/AppKernel.php on line 15
.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
! Push rejected, failed to compile PHP app.
! Push failed
Or at least this is where it starts to go wrong.
My AppKernel.php file looks like this..
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new AppBundle\AppBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
}
return $bundles;
}
If I comment out the Swiftmailer class in AppKernel, another class is causing the exact same issue.
I hope theres someone here who can help me out or at least to understand the error a bit more.
Truth be told, deploying applications and handling anything serverside is not my strongest site so im in pretty deep water.
Thanks... :)
Content-Length mismatch http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date