Setting up my development environment

The following are the commands I run to in stall my development environment:

sudo port install apache2

sudo port load apache2

sudo port install redis

sudo port load redis

sudo port install rabbitmq-server

sudo port load rabbitmq-server

sudo port install php56 +apache2 +mysql56 +pear

To customize php55, copy /opt/local/etc/php55/php.ini-development (if this is a development server) or /opt/local/etc/php55/php.ini-production (if this is a production server) to /opt/local/etc/php55/php.ini and then make changes.

sudo port install php56-bbcode

sudo port install php56-curl

sudo port install php56-exif

sudo port install php56-gd

sudo port install php56-gettext

sudo port install php56-geoip

sudo port install php56-iconv

sudo port install php56-imagick

sudo port install php56-mbstring

sudo port install php56-oauth

sudo port install php56-mysql

sudo port install php56-posix

sudo port install php56-memcache

sudo port load memcached

sudo port install php56-redis

sudo port install php56-sphinx

sudo port install php56-tidy

sudo port install php56-zip

sudo port install php56-openssl

sudo port install php56-apache2handler

cd /opt/local/apache2/modules

sudo /opt/local/apache2/bin/apxs -a -e -n php5

Fix Eclipse PDT CMD-click

I recently upgraded to the latest version of Eclipse + PDT. For some reason, the “jump to function definition” command was not woking anymore. Once you’re used to it, there’s no going back. Command-clicking on a function to automatically open its file and definition is so time saving I could not imaging working without it any more.

Hopefully I finally found this article by Adrian Schneider that explained how to solve this issue.

Simply shut down Eclipse, delete the .metadata/.plugins/org.eclipse.dltk.core.index.sql.h2 folder in your workspace and restart Eclipse. This will force the DLTK indexer to rebuild its database. That solved the issue for me!

A little update…

It’s been a while since I last posted on this blog. Loads of work plus me contributing to my company’s blog have made difficult for me to find time to write new articles in here. Although I have many blog posts in preparation, “almost finished” doesn’t mean anything until it’s really finished and online.

I’m hoping to add new posts soon and hopefully you’ll find them as interesting as the existing ones.

Installing Apache2 and PHP5 on Mac OS X Snow Leopard

I recently migrated to Mac and I have to say I’m really happy so far. I’m running Mac OS X Snow Leopard. My development environment is as follows:

  • Apache 2
  • PHP 5.3
  • Apc
  • Memcache
  • Xdebug
  • Imagick

I used to work with XAMPP under Windows XP. When I migrated to Mac I was first using MAMP as Snow Leopard just went out and I ran into multiple problems trying to compile PHP with the necessary extensions. I just found out that it’s not a problem anymore with the latest installations of XCode and MacPorts. Here’s how to install your dev machine…

Continue reading

Choosing the right PHP development environment

When I first started coding PHP websites, I was using Emacs on a Linux computer. Then I switched to UltraEdit on Windows. I had a Linux server on the local network running Apache with PHP and MySQL. My projects were on the server and I was accessing the files through Samba. When developing locally, I switched my hosts file in order to point my website’s hostname to my local server instead of the production one. I was using FTP to put files online. Today I’m using a much more evolved approach as the following describes…

Continue reading

Minimizing Javascript and CSS in Eclipse

Websites need to load as quickly as possible. The results of Internet connections being faster and faster is that we can’t stand anymore waiting for a page to load. We’re used to speed and if the page doesn’t load, I’ll just close the tab and go somewhere else.

Minimizing is the process of reducing the size of CSS and JavaScript files by compressing it. This is achieved by removing unnecessary white spaces and newlines and also by renaming JavaScript variables to something shorter. With this technique I’ve managed to reduce the size of some JS files by 50%. Yahoo! provides a wonderful tool called YUICompressor that does the job for you.

I’ve been looking for a way to automatically minimize JS and CSS files upon save in Eclipse in my PHP projects… finally found out how to do it!

Continue reading