Pages

Showing posts with label symfony. Show all posts
Showing posts with label symfony. Show all posts

2010-10-17

Configuring Mac Snow Leopard for Symfony development

If you want to develop symfony applications using the built in Apache web server in Mac OS X here are my notes. Keep in mind, this is not a production configuration but just the necessary steps to get a developer workstation up and running.
  1. Activate Web Sharing
    System Preferences -> Sharing -> Web Sharing
  2. Change your UserDir settings. In a terminal window, edit the file with your userdir configuration.
    vim /etc/apache2/users/username.conf
    Remove or comment the contents. Paste the following information:
    UserDir Sites/web


    <Directory "/Users/username/Sites/web">
        Options Indexes MultiViews
        AllowOverride All AuthConfig
        Order allow,deny
        Allow from all
    </Directory>

    Alias /~username/sf /Users/username/Sites/lib/vendor/symfony/data/web/sf

    <Directory "/Users/username/Sites/lib/vendor/symfony/data/web/sf">
      AllowOverride All
      Allow from All
    </Directory>
  3. Substitute the text username for you username.
  4. Enable php (and mysql if you want). See http://stackoverflow.com/questions/1293484/easiest-way-to-activate-php-and-mysql-on-mac-os-10-6-snow-leopard
  5. Now you can either install
    • the sandbox
    • the svn version,
    • the tar.gz version
    • or you can check out your existing project from source control.
  6. After you've installed symfony, edit the .htaccess file in the symfony web folder
    • Enable RewriteBase by uncommenting it
    • Change the RewriteBase directive  to RewriteBase /~username/
  7. Restart apache
    sudo apachectl restart

BTW: I wrote a more detailed post back in 2008. It hasn't been updated since then, but there might still be a few useful hints there: http://techinorg.blogspot.com/2008/07/ubuntu-post-install-customization.html

2008-12-25

firesymfony - using firebug with symfony

Found a Firefox add on for symfony development while I was downloading firebug today. Haven't tried it yet, but might give it a try next time I'm working on one a symfony project.

2008-07-21

Ubuntu post-install customization

Here I've collected some of the things I did last time I installed Ubuntu from scratch on my commuting-part-time-LAMP-developer laptop.
  • Get security upgrades.
  • Install my favourite firefox extensions:
    • Firebug. The must have web developer extension.
    • Delicious bookmarks. I don't care much for the social part of it (at least right now,) but I consider it the best bookmarking feature I've found.
    • Scrapbook. Commuters best friend! Allows me to download web sites recursively, read, and even search in downloaded web pages.
    • All-in-One gestures. (I absolutely love keyboard shortcuts, but when I am using the mouse, why change back to the keyboard just to go back to the previous page? With mouse gestures it's just pressing the right button and drag the mouse to the left, release, welcome back.)
    • Google gears. (For offline access to Remember the Milk.)
  • Install LAMP-server. (Using Synaptic.)
  • Install subversion.
  • Install php-pear.
  • Install symfony by running the commands below in a terminal:
    • sudo pear channel-discover pear.symfony-project.com
    • sudo pear install symfony/symfony-1.1.0
    (Symfony is, in my opinion, one of the best php frameworks out there. Maybe also one of the best web frameworks, regardless of language.)
  • Download PHP Development Tools. Since last fall, Ive considered the eclipse based PDT a better alternative than anything else I've used, including both commercial and open source alternatives. Earlier I used to use jEdit, an awesome heavyweight text editor (hey, I've got 2 GB RAM, and I don't really care if it uses 40 MB as long as it is the best editor I know.) in combination with a lightweight alternative like notepad++ (on Windows) or gedit or kate on Linux.
  • Download the php documentation.
  • Using the Scrapbook extension mentioned above, download the symfony 1.1 book. (After installing the Scrapbook extension it's just a matter of right clicking the site, choose "Capture Page As..." from the context menu and set depth to follow links to "1" under "In-depth Capture". And if you're in a hurry, like me, choose "Filter" and "Restrict to Directory", so that you'll only download the relevant files.
  • Install keepassx and copy the old database from the backup. I use it to keep rarely used passwords, serial keys (e.g. vmware server,) and other details that I don't want to be available for whoever uses my PC.
  • Install vmware server.This used to be a matter of installing it from the repositories, but now it's slightly harder. Here is the best way I've found to install it on Ubuntu Hardy Heron, a script made by Brett Alton.
Edit 2008-07-22: Forgot a couple of details when first publishing this post last night.
  • Add nautilus-gksu from repostitory.
  • Add nautilus-open-terminal from repostitory.
  • Add edit as root to the nautilus context menu. It really shouldn't be necessary to open a terminal to edit /etc/fstab . (e.g. for enabling acl)
Edit 2008-07-30: Another detail:
  • Add php-xsl from repository. Without this, data-load doesn't work.
Btw: Seems like I'd rather use this checklist myself next time : )

2008-02-23

I never thought of using tail that way before

While debugging a symfony app I suddenly realized that I could grep tail:

tail -f log/frontend_dev.log|grep someword

I realize it's quite obvious, it just took a couple of years before I thought of it :)