Development

#72 (Unable to write cache file)

You must first sign up to be able to contribute.

Ticket #72 (closed defect: invalid)

Opened 5 years ago

Last modified 4 years ago

Unable to write cache file

Reported by: vilas@bbs.olografix.org Assigned to:
Priority: minor Milestone: 0.6.0
Component: Version: 0.6.1
Keywords: cache, write Cc:
Qualification:

Description

On php 5.0.4, apache 2, with symfony 0.5.258.

# symfony init-project askeet
# symfony init-app frontend

and, having defined a virtual host for http://askeet.palomalab.net, the page returns:

[exception] sfCacheException [message] Unable to write cache file 
"/home/palomar/askeet/cache/frontend/prod/config/config_config_handlers.yml.php" [code] N/A 
...

Change History

12/11/05 11:51:20 changed by anonymous

  • priority changed from blocker to major.

12/11/05 13:52:39 changed by fabien

  • status changed from new to closed.
  • resolution set to invalid.

Check that your cache/ and your log/ directories is writable by your web server.

12/12/05 00:55:54 changed by vilas@bbs.olografix.org

  • priority changed from major to minor.
  • status changed from closed to reopened.
  • resolution deleted.

I am sorry I have to reopen this, Fabien, although as a minor bug. It has indeed to do with permissions, but not so trivially, since cache/ and log/ are set to 777 soon after symfony init-project is invoked and no one ever changes it.

It must be something else and it may also depend on php or apache configurations, but it happens right after the init-project and init-app symfony commands on a standard server configuration that is hosting another working symfony project; it may well discourage people from going further with symfony, so I think it deserves a bit of attention from the community.

Activating track_errors and changing "@mkdir" into "@mkdir or die", into the sfFileCache->setCacheDir() method, the 'Permission denied' error keeps coming out.

safe_mode is turned off and open_basedir is set to no value as far as php configuration is considered. (see http://askeet.palomarlab.net/test.php for details)

12/12/05 06:52:08 changed by acidbox

chmod -Rf 777 cache log

12/12/05 10:58:58 changed by vilas@bbs.olografix.org

  • status changed from reopened to closed.
  • resolution set to invalid.

Ok, SELinux was the problem. The server is a FC4 with SELinux turned on.

chcon -Rt httpd_user_content_t [dir]

does the trick.

Turning SELinux off works, too. Maybe a small note in the manual could help.

03/14/06 02:57:08 changed by anonymous

  • priority changed from minor to critical.
  • status changed from closed to reopened.
  • version changed from 0.5.X to 0.7.X.
  • resolution deleted.

i got this after reading every informations here my config is correct

[exception] sfCacheException [message] Failed to write cache file "/home/httpd/htdocs/symfonyapps/test1/cache/myapp/prod/config/config_config_handlers.yml.php" generated from configuration file "config/config_handlers.yml" [code] N/A [class] sfConfigCache [file] /usr/local/lib/php/symfony/config/sfConfigCache.class.php [line] 345 [symfony] v. 0.6.1 (symfony-project.com) [PHP] v. 5.1.2 [stack trace]

at sfConfigCache::writeCacheFile() in /usr/local/lib/php/symfony/config/sfConfigCache.class.php:101 at sfConfigCache::callHandler() in /usr/local/lib/php/symfony/config/sfConfigCache.class.php:194 at sfConfigCache::checkConfig() in /usr/local/lib/php/symfony/config/sfConfigCache.class.php:279 at sfConfigCache::loadConfigHandlers() in /usr/local/lib/php/symfony/config/sfConfigCache.class.php:58 at sfConfigCache::callHandler() in /usr/local/lib/php/symfony/config/sfConfigCache.class.php:194 at checkConfig() in /usr/local/lib/php/symfony/symfony.php:137 at require_once() in /home/httpd/htdocs/symfonyapps/test1/apps/myapp/config/config.php:85 at require_once() in /home/httpd/htdocs/symfonyapps/test1/web/index.php:8

i got OpenBSD my log and cache dirs are set to www:www and 777 either to be sure and still the same any help how to resolve this issue

03/14/06 10:17:32 changed by francois

  • status changed from reopened to closed.
  • resolution set to invalid.

This is not a symfony bug but a particular config issue. Please refer to the forum for problems about installation.

04/13/06 21:40:09 changed by anonymous

  • priority changed from critical to minor.
  • version changed from 0.7.X to 0.6.1.

I got this same problem when meta-following the instructions here: http://www.symfony-project.com/content/book/page/project_creation.html

chmoding 777 the cache and log directories wasn't enough. After getting the error I had to go back and chmod -Rf them, presumeably after some part of the process re-created directories in there that didn't have proper permission. None the less, it seems to me that it is just a permission issue caused by removing and recreating the directories.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.