It seems that only on the production server warming up the cache causes an error. This is how I try to warm up the cache:
$ rm -rf app/cache/*
$ chmod -R 777 app/cache/
$ php app/console doctrine:cache:clear-metadata --env=prod
$ php -r "apcu_clear_cache();"
$ php app/console cache:warmup --env=prod --verbose
On my local dev environment this works like a charm. I'm using Symfony 2.8.22 and PHP 7.0. The error is on my production server is:
[Symfony\Component\Debug\Exception\FatalErrorException]
Compile Error: require(): Failed opening required '/home/wingman/Symfony/app/cache/pro_/doctrine
/orm/Proxies/__CG__CmsCoreBundleEntityPagePageGroup.php'
(include_path='.:/opt/alt/php70/usr/share/pear')
Exception trace:
/home/wingman/Symfony/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209
I have already stripped down the entity, that the error is about, to a minimum:
/**
* @ORM\Table(name="cms_cr_page_group")
* @ORM\Entity(repositoryClass="Cms\CoreBundle\Entity\Page\PageGroupRepository")
*/
class PageGroup {
/**
* @ORM\Id
* @ORM\Column(type="integer", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;