I am trying to migrate my PHP application to an Ubuntu server, but without succes. Any help would be appreciated.
First I installed Doctrine successfully into /jorrit/mya
In code after $config
line you could try
$config->setAutoGenerateProxyClasses(true);
But the CLI version is much better, because it avoids on refresh regen as in code might not avoid.
To change cache dir you could try:
$cacheDir = dirname(__FILE__).'/cache';
if (!is_dir($cacheDir)) {
mkdir($cacheDir);
}
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode, $cacheDir);
Looks like a permission problem, first should chek on permissions for the entire application folder.
Also try to hard-cleanup cache by deleting app/cache/* files, and try again.
Good luck!
TL;DR You'll just need to generate your proxy classes manually
vendor/bin/doctrine orm:generate-proxies
Doctrine uses Proxies to connect the to database. Proxies are generated from the the Entity classes.
In development mode, it generates a Proxies on every request because you could make changes to Entity classes.
In production mode, it does not generate Proxies every time. For performance reason, it assumes the Proxies exist and include them directly.
There are a few mode for Proxies generation:
Now the command
vendor/bin/doctrine orm:generate-proxies
generates Proxy classes to /tmp. I would say this might still cause trouble because other applications on your server might delete these files unexpectedlly. One option is you can change your /tmp directory access permission to 1777
sudo chmod 1777 /tmp
The stricky bit '1' in front of 777 means that, although everyone can read/write to the /tmp directory, but you can only operate on your own files. i.e. You can't remove files created by other users.
For further reading, please have a look at http://docs.doctrine-project.org/en/latest/reference/advanced-configuration.html#auto-generating-proxy-classes-optional
You can also set the Proxies directory to somewhere else so no other applications can modify them. http://docs.doctrine-project.org/en/latest/reference/advanced-configuration.html#autoloading-proxies