Command Line PHP Server

I spend a lot of time in Rails and Middleman and other Ruby frameworks. But, every once in a while I need to do some Wordpress development, and switching between those two environments can be a pain if you're not careful.

My old way of dealing with this was to:

  1. Shut down Pow
  2. Start up Xamp
  3. Play around in my /private/etc/hosts file
  4. Flush my DNS
  5. etc.

That's just not ideal. Lucky enough, PHP 5.4.0 and higher include a built in command line server. This is perfect for me. All you have to do is run this from the directory you want to serve:

php -S localhost:8000

More info is available in the PHP documenation.

Being Productive

As a web developer, I earn my living based on what I can produce. I'm not paid to sit in meetings, or craft email responses; although, I have to do those things, as well. I'm paid to be productive.

I am most productive when I have long, uninterrupted blocks of time to work. However, as you may know, working from a computer all day comes with all sorts distractions these days. I've come up with a few guidelines that may seem harsh, but don't take them personally if you've tried to talk to me. This is just what I've found works really great for me.

Control Your Communication Channels

If you're like me, it's a bad day when someone calls you, leaves a voicemail, sends an email with the same information, and finishes it off with a text to let you know about their other transmissions. There are too many ways for people to contact us. You need one place to view and prioritize the endless stream of messages you receive. For me, this is ultimately email.

To try to push things towards email, here are some boundaries I try to set:

  • All work is done over email.
  • Use an online project management tool that generates emails: Basecamp
  • Never text about work.
  • If a call or meeting is necessary, schedule it over email in advance.
  • When it's necessary to have real time chat, use Hipchat, Google Hangouts or not group texting.

Texting is the most convenient and the most invasive way to contact someone. If it's about work, please email or post to basecamp or something. People need to be able to turn off after work hours. Which leads me to my next point...

Control When You Communicate

It is impossible to control when someone will communicate with you. But, you can control how and when you see it. We have taken care of the how, now here are some ways you can control when:

  • Turn your email client off, and only check it at scheduled times throughout the day. I read and answer emails after lunch, and right before I quit for the day.
  • Turn off all push notifications on your phone regarding email, Hipchat, Google Hangouts, and other work-related messaging.
  • If someone calls or texts you while you're in the zone, return their call or text when you're done.
  • Maybe even put your phone on 'Do Not Disturb', but I try to leave that line of communication open for my wife and emergencies.
  • Only keep programs on your computer open that you are using.

The goal here is to prevent as many things as possible from interrupting you. This gives you the best chance at having long periods of uninterrupted time. Aside from extreme circumstances, no single work related message is important enough that you must see it and act on it right away. In those extreme conditions, people are going to be calling you anyways.

Have Friends

Yes, you get to have friends now! A side effect of setting up these communication boundaries is that after work hours, and during the weekend, you get to be friends with the people you work with. If your coworkers text or call you about work all the time, then when they text you over the weekend about something completely unrelated you will not want to read it. Setting boundaries is healthy for you personally, and for your relationships. So, go make some friends now.