Upgrading to PHP 7 on OS X

This week, PHP 7 was released, and the upgrade process is fairly simple. It's also possible to have two (or more) versions of PHP installed, assuming you use Brew, which makes it very easy to test that code works in PHP 7.

Requirements:

Installation steps

  • First, do a brew update, just to make sure you've got the latest build of PHP 7. (The RC versions were also available via Brew)
  • If you have installed previous versions of PHP with Brew, you will need to unlink the previous version, for example for 5.6 you can use brew unlink php56. This seems to only affect phar, if this is something you use, you may have to use brew switch whenever switching versions
  • If you have never installed PHP using brew before, you can ignore that previous step
  • Install 7.0: brew install php70
  • Edit the Apache config (/etc/apache2/httpd.conf), to insert the lines outputted by brew:

For example:

LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so <FilesMatch .php$> SetHandler application/x-httpd-php </FilesMatch>

  • Comment out any other PHP modules (don't delete them: this makes it easier to switch versions)

For example:

#LoadModule php5_module libexec/apache2/libphp5.so #LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so

  • Restart apache: sudo apachectl restart
  • Edit (or create) ~/.bashrc

I use the following code, which makes switching between versions easier:

#export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH" export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"

  • Close and reopen your terminal, so that it is using the correct version
  • Confirm you're running 7.0 by running php -v, to check Apache is using the correct module, you can create a php file with phpinfo() in /Library/WebServer/Documents/ and visithttp://localhost on your local machine

To switch back to previous versions, you only need to edit the Apache config and restart Apache. You can also use the export command to switch between versions for the commandline.

Battery Bulge

Apple introduces a Smart Battery BulgeCase

The Smart Battery Case is engineered specifically for iPhone 6s and iPhone 6 to give you even longer battery life and protection.

Just give us a thicker iPhone!

Slow down, Apple

Brent Simmons:

There’s a reason, I’m sure, and I bet there’s an easy fix.

My point is that this shouldn’t be allowed to get into a state where it’s annoying.

What I’m hoping for — what I’m nearly begging for, more as a user than as developer — is that Apple spend a year making things better. Nothing new. Just make things work better.

This. Apple needs to slow down.

Sketch leaves the Mac App Store

There are a number of reasons for Sketch leaving the Mac App Store—many of which in isolation wouldn’t cause us huge concern. However as with all gripes, when compounded they make it hard to justify staying

Apple are relying on the goodwill of developers and loyal customers too much. It's not even arrogance. It's not giving these kind of problems the attention they need, instead choosing to bury their head in the sand.

If Apple aren't careful, a lot of developers may start to find it hard to justify staying with the platforms as a whole.

Spoilers

Katie Sherwin, for Nielsen Norman Group, nails it when it comes to TV spoilers on the HBO Now service:

Much to my dismay though, each time I click on the Game of Thrones thumbnail, it reveals a big image of the latest episode — complete with characters that I didn't know were still alive, in contexts that give away the plot. I see who is together arm in arm, which villains are undeservedly still in power, and which heroes are alive and in jail.

I literally have to block the screen with my hands each time I go to watch an episode. A friend of mine uses the squint approach: half looking away in order to blur the revealing images and summary text, while he maneuvers the mouse to the correct season.

And she perfectly sums up the problem:

Satisfying multiple sets of user needs doesn't mean designing for the lowest common denominator. It's about empathy with the different use cases and making sure that the content for one audience, even if it’s a main audience, doesn’t ruin the experience for a different use case.

Absolutely. It's the modern equivalent of looking away from seeing the football results.

Which reminds me: I've lost count the number of times BBC News have spoilt the F1 results for me beforethey air the extended highlights show...

Speaking: NWDUG

A little last minute, but I will be speaking at North West Drupal User Group tonight, doing my code review lightning talk: "There's More To Code Reviews Than You Might Think".

It all starts from 7pm at MadLab, Manchester.

Slides

Sherlocked

With iOS 9.1 comes UK support for Apple's new News app.

I've been using News for some time now using the location hack I previously documented, alongside various other alternatives.

I even wrote my own news reading app, called Newsrack, which is certainly in a releasable state. But I've never quite been happy enough with it to push it onto the App Store, despite on and off development and tweaks and polishes throughout the years.

Apple's News isn't perfect, and it's annoying in some ways. But I keep coming back to it. I even prefer it to my own work, which isn't quite right.

I've been Sherlocked. And I'm ok about it, because this is the app I wanted to make.

Enable Field Test mode on mobile phones

When most people talk about cell phone signal strength, they talk about “bars” in reference to the signal strength bar indicator on the phone. While bars are an easy way to talk about signal strength, it turns out that it’s not a very accurate way.

This is something I try to turn on on my iPhone (scroll down to "Always show Decibels instead of Dots") whenever I can, as I find dots very vague.

Here's To The Crazy Ones

Here’s to the crazy ones. 
The misfits. 
The rebels. 
The troublemakers. 
The round pegs in the square holes. 
The ones who see things differently.

They’re not fond of rules. 
And they have no respect for the status quo.

You can quote them, 
Disagree with them, 
Glorify or vilify them.

About the only thing you can’t do 
Is ignore them.

Because they change things. 
They push the human race forward.

And while some may see them as the crazy ones, 
We see genius.

Because the people who are crazy enough to think they can change the world, 
Are the ones who do.