March 11, 2007

Symfony project: Cries from the Sandbox

Filed under: Articles,Cult of Mac,PHP,Technology — Allan @ 10:22 am

Started reading about Symfony a few weeks ago, and finally got a bit of time to actually give it a try. As they suggest, if you just want to muck about with it and not do any serious development yet, grab the sandbox install as it will just work out the box.

What follows are some problems I ran into getting it running under OS X, and the things I did to get round them.

Cache Permissions
Once you’ve extracted the archive you should have a sf_sandbox directory, in which the whole Symfony framework and web app lives. The first problem was that Symfony likes to cache stuff and the web server didn’t have the right permissions to write out the cache files. When I tried to run the app, I was greeted with

Warning: mkdir() [function.mkdir]: Permission denied in /Users/allank/Sites/sf_sandbox/lib/symfony/cache/sfFileCache.class.php on line 552

Warning: Cannot modify header information - headers already sent by (output started at /Users/allank/Sites/sf_sandbox/lib/symfony/cache/sfFileCache.class.php:552) in /Users/allank/Sites/sf_sandbox/lib/symfony/exception/sfException.class.php on line 101

To fix, I opened up a Terminal, changed to the sf_sandbox directory (in this case /Users/allank/Sites/sf_sandbox) and did a chmod a+w cache. It’s just for me to test, if I ever migrate to a proper dev/production environment we’ll see what permissions they suggest.

The next problem that cropped up was trying to build the propel model files. Symfony requires PHP5 and I’d chosen to upgrade my PHP from the 4.4.4 version that shipped with OS X by downloading and compiling the PHP5 source, and I hadn’t included XSLT support.

Could not perform XLST transformation. Make sure PHP has been compiled/configured to support XSLT.

PHP5 uses the XSL extension to provide XSLT support, so a quick configure of my PHP source with

'./configure' '--with-apxs' '--with-mysql=/usr/local/mysql' '--with-zlib-dir=/usr/local/lib' '--with-libjpeg=/usr/local/lib' '--with-libpng=/usr/local/lib' '--with-gd' '--with-xml' '--with-xsl'

followed by a make and make install, and a restart of Apache and we were all set.

Database permissions
The example project uses SQLite as the database, and uses a default database file that lives at data/sandbox.db. When I tried to generate the table structure from the generated SQL i got more permission errors. Further down the page in the section on creating the application scaffolding they suggest that on *nix based systems you will need to chmod 777 data/sandbox.db, but you need to do that before you try to generate the table structures.

Log permissions
Symfony tries to log everything in the sandbox environment

Unable to open the log file "/Users/allank/Sites/sf_sandbox/log/frontend_dev.log" for writing

so a quick chmod -R a+w /users/allank/Sites/sf_sandbox/log sorted that out.



  1. Thanks very useful information

    Comment by Mafiuss — February 29, 2008 @ 11:44 pm | Reply

  2. Thank you very much!

    Comment by Wharenn — June 17, 2008 @ 9:36 am | Reply

  3. actually, if you read from the tutorial, they suggest to add the -p switch to tar, as the archive comes with the permissions already fixed : cache , log, data and data/sandbox.db are set correctly.

    So tar zxvfp sf_sandbox_1_1.tgz does the trick

    Comment by jukea — June 19, 2008 @ 5:09 pm | Reply

  4. Thanks jukea, that’s a good point. Of course some people (like me) may be on a Mac, and the Finder un-archives the file for you, without the necessary permissions.

    Comment by Allan — June 19, 2008 @ 5:14 pm | Reply

    cs3 discount software, ms office 2003 key
    microsoft web page software free adobe software for students
    selling software over can buy photoshop List Software Downloadable Software
    i buy adobe photoshop discount software house
    purchase discount software discounts for software
    autocad 2005 trial activation code cheap software to buy

    Comment by MikeUseds — December 6, 2009 @ 8:13 am | Reply

  6. some cheap softwares does not offer good online technical support so i would caution about using them ~-*

    Comment by Pedestal Table — November 24, 2010 @ 7:50 pm | Reply

  7. muchas gracias compadre!

    Comment by jose — April 21, 2011 @ 8:30 pm | Reply

  8. This was an interesting post

    Comment by transformers — July 22, 2011 @ 4:24 pm | Reply

  9. magnificent points altogether, you just gained a new reader.
    What would you recommend in regards to your post that you just made some
    days ago? Any positive?

    Comment by kindle fire manual — March 29, 2013 @ 4:14 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: