简体   繁体   中英

hosting symfony2 app on azure web app

i have a problem hosting a symfony2 app on azure. It am always getting an "Failed to write cache file" error in Filesystem.php. I guess that php does not not have the permission to write to the cache folder. How can i give php the permisson to modify the cache, without webdeploy or git, i only have ftp and the azure management portal.

KR Manuel

You have to set the correct directories for logs and cache in your Kernel. And you can usually set permissions for that folder using your FTP client.

public function getCacheDir()
{
    if ($this->getEnvironment() == 'prod') {
        return 'D:\\home\\data\\cache\\prod';
    }
    return parent::getCacheDir();
}

public function getLogDir()
{
    if ($this->getEnvironment() == 'prod') {
        return 'D:\\home\\LogFiles\\app\\';
    }
    return parent::getLogDir();
}

there is also a pre-made bundle to take care of these things: https://github.com/brainsonic/AzureDistributionBundle

and even a detailed tutorial: http://symfony.com/doc/current/cookbook/deployment/azure-website.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM