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.

XSLT
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.