My best php development setup so far

August 11th, 2008

Or: Ubuntu + Apache + MySql + Gnome + Eclipse pdt + gVIM + nautilus + firefox

Sort of..

Long post coming. Beware!

Ubuntu

Ubuntu is my current operating system of choice, for a few good reasons. First of all, I would choose Linux over Windows on any given day. My current installation has survived 1.5 years+ and it’s still going strong. While I have tried several Linux flavours over the years (I started with Slackware, went on to Debian, then Gentoo, Fedora and Ubuntu) I have chosen Ubuntu in the end because of one single important detail: I don’t have to worry about any OS issues. I focus on coding and the OS just works. I’d just love to have Gentoo compiling and recompiling itself over and over again, If I had 10 intel quad cpus it would be my favourite OS ever. But I just don’t have the time and resources to take care of it.

Apache

Need I say more? It works, it does its job well, and it’s found on most LAMP hosting accounts. The /var/www directory is the root of the server. I hold all my projects in one directory on my desktop, so I have Desktop/web_projects/project1 , Desktop/web_projects/project2 , and so on. I symlink /var/www to the current project I’m working on. If I would be working on project1, /var/www would point to /home/user/Desktop/web_projects/project1. This way I don’t have to use vhosts on my local server and I have all the files neatly set up in project directories. Each directory gets its own project in Eclipse PDT.

MySql

Not much here.. Stock MySql installation, sometimes PostgreSql, each project uses its own database, and because I’m lazy, while developing locally, all my php scripts connect with the root mysql account.

Gnome + Nautilus

I absolutely hated this thing when I first started using it. Luckily the gnome project has matured now and It’s really stable and easy to use. A few things I really like about it:

-ftp support (Places->Connect to server…)

-bookmarks for local and remote directories/connections

-open console here (Nautilus plugin)

-multiple desktops (one for developing, another one for docs.. switch with ctrl+alt+left (right) )

-ctrl+alt+d minimizes all windows (same as winkey+d on Windows desktops)

-It’s non intrusive. Learn to use it and you will find it to be a very good tool for the job. Just disable all the 3d effects, I can’t seem to get anything done when the windows are flying around.

-really good ‘open with’ context menu

Eclipse PDT

Eclipse is one of the best free IDEs out there. The PDT plugin can be installed on a stock Eclipse installation or a fully featured eclipse+pdt bundle can be installed. At the time of this writing, in Ubuntu you HAVE to download the eclipse+pdt bundle, because the current version of PDT does not install on the sligtly older version of Eclipse available in the Ubuntu repositories.

PDT stands for PHP Development Tools. What does that mean in plain english?

-allows you to create a new ‘php’ project

-supports auto-completion for class methods and standard php functions (ctrl+space)

-shift+f2 opens php.net documentation for current function

-hover tips

-code formatting ( ctrl+shift+f … sucks for php imo… will dedicate a full post to this)

-supports CVS and SVN (with a plugin)

-supports FTP (but is slightly on the non-intuitive side..)

-has local history for each file

Eclipse is ever evolving and expanding. While I’m not really a big fan of IDEs, this is a tool that has really helped me with larger projects, and got me more organized with designing classes (mostly because of the autocomplete feature).

Me not being a fan of IDEs brings me to my next point…. (and some will hate me for this

VIM or gVIM

Well, you didn’t see this one coming, did you ? Vim is *the* geekish editor out there. You can run it on gnome. You can run it in the console. You can even run it over ssh. It can open local and remote files on a number of protocols. It does CVS, it does SVN, it does syntax highlighting, it does code autocompletion.

Well… if it’s so good, why do I still use Eclipse?  Dunno, maybe I simply haven’t mastered all the possible keyword combinations, maybe I’ve installed one too many plugins in it, maybe I think ctags is slow.. Who knows…

Nevertheless, this tool remains the swiss army knife in my toolbox, I use it for any editing needs, and I’ve written quite a lot of php code with it.

Firefox

Why do I use firefox ? I dont’ really know, it’s rather slow lately, I’ve got a ton of extensions installed on top of it, and it’s eating away my resources. I guess I can’t help from clicking that icon.

I also have the Epiphany browser installed (mozilla engine based), as well as Opera and Internet Explorer ( google ies4linux )

Oh and.. I use the console a lot. When I test new functions or classes I write test programs and mess with them in the console for testing purposes. The standard gnome-terminal is just fine. I would really miss this in the ‘other’ bit OS.

That’s about it for now. Long post. Tired. Must get back to coding. bye.

Here’s my php blog…

August 11th, 2008

Every blog has to have a first post. That’s how things go. If you haven’t guessed it yet, this is gonna be a php blog. Why? you might wonder. Here are a few good reasons:

  • PHP is a wonderful language. From where I stand, it’s the best language for server side web programming.
  • I work with PHP all day long. And I love it.
  • I’ve found several online PHP resources to be outdated or… totally WRONG. I learned PHP through the process of trial and error. http://www.php.net was my best friend.
  • I needed some blog subject :)

Php is ever evolving, with massive improvements from one version to the next, with a few absolutely great tools and frameworks available, allowing programmers to write countless web applications.

Hello to any php programmers out there!