How To, Ubuntu, Web /

How To: Enable PHP 7 OPcache on Ubuntu 16.04

When looking for how to enable OPcache on Ubuntu 16.04 and PHP 7.0, I found several guides for legacy platforms such as Ubuntu 14.04 and PHP 5.5

Many sites, particularly those built on CMS frameworks such as WordPress, Joomla and Drupal, use a complex code and consume many processes. Several website speed enhancement plugins are available, heavily featured within the yield of a typical search engine recommendation. Most of them do not explain how to enable opcode caching server-side – thankfully, it’s simple to implement.

A cursory search for ways to speed up websites will yield plugins and bolt on that only address part of the requirement. The Power Users amongst us need to know how to enable functionality server-side. This short guide will cover off the basics to get you started with OPcache on Ubuntu 16.04 with PHP 7.

For more detailed runtime options, take a look at the site which has a page of all the runtime options available.

To get OPcache set up requires some changes in the php.ini file on your server.

Open php.ini in your favourite text editor

To get started open your php.ini file. Depending on your configuration, this will be in one of two locations:

Apache web servers


Nginx web servers


Enable OPcache

To enable the OPcache, change to the following lines of your php.ini file:


Change to:


Note: Remember to uncomment this line and other configuration lines (remove the “;”) as well as change the “0″ to “1″ Otherwise your change won’t take effect.

Modify the amount of RAM the OPcache will use

With OPcache, there is a trade-off between speed and the amount of RAM used. The more RAM you are willing to dedicate to storing opcode, the more opcode that can be stored. There is a diminishing return at some point, because some code will execute rarely, or your code base might not be that big. It is worth playing with this setting to see where you get the best performance-versus-RAM trade-off.  This setting is in megabytes.


Change to:


Boost the number of scripts that can be cached

OPcache has a strange setting that requires you to not only adjust the amount of RAM but also define the number of scripts that can be cached. You have the option of tuning this parameter for your own application too, especially if you find that your hit rate is not close to 100 percent.


Change to:


Change the revalidate frequency

To make sure that the OPcache notices when you change your PHP code, you can set the revalidate frequency. Basically, this will tell the cache how often to check the timestamp on the files. This is measured in seconds.

;opcache_revalidate_freq = 2

Change to:

opcache_revalidate_freq = 240

Verify that the PHP OPcache mod is enabled

Believe it or not, that converts most of the settings you will need to get started. PHP7 has its own module system (since 5.4), so make sure that OPcache is enabled.

sudo phpenmod opcache

Restart PHP

You should now be all set to start using PHP 7’s OPcache. You just need to restart the appropriate service to get it going.

Apache web servers

sudo service apache2 restart

Nginx web servers

sudo service nginx restart

You’re done! Enjoy.

Inspiration taken from Hosting Advice. Credit also to the commentors of that post. I've simply gelled the info into a guide for the current trunk versions.
Featured image credit: Michelangelo van Dam (Flickr - Creative Commons)
iOS /

iOS 10 Apple’s release notes in full

If you love details then you’re in for a treat. Apple have published the full release notes for iOS 10.

● Expressive Messaging
○ Bubble effects let you send messages loudly, gently, slam or with invisible ink
○ Full-screen effects to celebrate special moments
○ Tapback for quick replies to messages, links, and photos
○ Handwritten messages animate like ink on paper
○ Digital Touch lets you send sketches, taps, and heartbeats
○ Tap to replace can emojify your text with just a tap
○ Rich links show a preview of web pages you share
● iMessage apps
○ New App Store for iMessage
○ Use the power of apps in Messages to share and collaborate with friends
○ Download stickers to send and place on text bubbles and photos

● Siri now works with the following types of apps
○ Messaging apps to send, search and read back text messages
○ VoIP apps to place phone calls
○ Photos apps to search for images and photos
○ Ride service apps to book rides
○ Payment apps to make personal payments
○ Fitness apps to start, stop, and pause workouts
○ CarPlay automaker apps to adjust climate, radio, seat, and personal settings

● All new look
○ Proactive suggestions for places you’re likely to go next, based on your routine or appointments in Calendar
○ Improved search with new callout design, clustered results and category filters
○ Home, work, favorite locations, and locations from upcoming Calendar events are displayed on the map
○ Displays where your car is parked via CarPlay or Bluetooth
○ Weather for the currently viewed area
● Extensions
○ Make a reservation within Maps using extensions from participating reservations apps
○ Book a ride to a destination within Maps using extensions from participating ride service apps
● Turn-by-turn navigation improvements
○ Search along route for gas stations, food, and coffee shops
○ Automatic view adjustment of the road ahead
○ Use pan and zoom during navigation
○ Option to avoid tolls and highways

● Advanced face recognition designed with deep learning to automatically group similar faces together
● Object and scene recognition to intelligently search for photos by what’s in them using advanced computer vision that scans your library locally on device
● Places album to see all your photos, videos and Live Photos on a map
● Memories
○ Intelligently highlights forgotten events, trips, and people, and presents them in a beautiful collection
○ Memory movies automatically edited with theme music, titles, and cinematic transitions
○ Related memories make it easy to rediscover even more photos in your collection, based on location, time, people, scenes and objects
○ Easily share with family and friends
● Brilliance control applies region-specific adjustments to brightness, highlights and contrast

● New Home app to securely manage and control HomeKit enabled accessories
● Scenes to control groups of accessories with just a tap
● Rich Notifications with quick actions to control accessories
● Optionally share home access with family and friends
● Remote access and automation of accessories with Apple TV or iPad

Apple Music
● An all-new design for Apple Music brings greater clarity and simplicity to every aspect of the experience
● Navigate your Library with an improved menu and see all of the Downloaded Music that you can play on your device while offline
● See recommendations in For You that highlight mixes, playlists, albums, and Connect posts—selected for you based on the music and artists you love
● Visit Browse to more easily see exclusive releases, find curated playlists, and discover the most important new releases—picked by our editors each week
● Listen to Radio more easily—clearly see what’s live on Beats 1, hear your favorite shows on-demand, or choose a curated station for any genre of music
● Play music with an improved Now Playing experience—swipe up to view available lyrics and quickly see or edit songs that are coming up next

Apple News
● An all-new design in For You adds bold typography, vibrant color, and distinct sections that make it easier to find stories on specific topics
● See the most important stories of the day within Top Stories—updated by our editors throughout the day
● Find the most popular stories right now within Trending Stories—selected based on what others are reading
● See all of your stories grouped into easy-to-understand sections on the topics you follow or read
● Discover the best and most interesting stories of the week within Featured Stories—selected by our editors
● Share stories more easily—just tap the icon on any story to send it to a friend right from For You
● Receive breaking news notifications from some of your most trusted sources
● Subscribe to your favorite magazines and newspapers directly in News
● New personalized Today View widget lets you keep up with the latest stories throughout the day

● Raise to Wake automatically wakes the screen as you raise your iPhone
● Rich notifications that support real time information, audio, photos and videos
● Today view is redesigned and supports all new widgets for apps like Weather, Up Next, Maps, Stocks and more
● Control Center is redesigned with easier to access controls including dedicated cards for music playback and Home
● Expanded use of 3D Touch
○ Lock screen notifications to support an expanded view and access to quick actions
○ New quick actions for built in apps like Weather, Stocks, Reminders, Health, Home, FaceTime, iCloud Drive and Settings
○ Home Screen widgets
○ Control Center for access to quick actions for Flashlight, Timer, Calculator and Camera
○ Clear all in Notification Center

● New emoji, including gender diverse options to existing characters, single parent family variations, rainbow flag and beautiful redesigns of popular emoji
● Contextual predictions for current location, recent addresses, contact information and calendar availability using deep neural network technology
● Emoji predictions
● Calendar events are intelligently populated using deep learning technology with information from your conversations in Mail and Messages
● Multi-lingual typing now lets you type in two languages at once without having to switch keyboards
● Rest & Type on iPad intelligently adapts to your unique typing patterns
● Predictive typing now uses deep neural network technology for greater prediction accuracy

● Voicemail transcription (beta)
● Spam call alerts with spam call identification apps
● Support for third party VoIP apps receiving calls on the Lock screen, including support for Call Waiting, Mute and Do Not Disturb

Other improvements
● Apple Pay in Safari
● View two pages at once using Split View in Safari on iPad
● Notes collaboration lets you invite people to work on your notes together
● Markup support in Messages, Photos and PDFs stored in Notes
● Bedtime Alarm in the Clock app lets you set a regular sleep schedule and receive bedtime reminders
● Health adds support for health records and organ donation (US Only)
● Stabilization support for Live Photos for improved camera capture
● Live Filters support when capturing Live Photos
● iCloud Drive now supports Desktop and Documents folders from macOS
● Live search results in Spotlight for Chinese and Japanese
● Siri support for Spanish (Chile), Chinese (Cantonese – China), English (Ireland), English (South Africa)
● Ling Wai and Kaiti Black document fonts for Chinese
● Yu Kyokasho and Toppan Bunkyu fonts for Japanese
● New definition dictionaries in Traditional Chinese and Danish and bilingual dictionaries in Dutch and Italian
● New keyboard for Spanish (Latin America)

● Magnifier now uses the camera on your iPhone or iPad like a digital magnifying glass for real-life objects
● New range of display color filters to support different forms of color blindness or other vision challenges
● VoiceOver adds a Pronunciation Editor to customize the way words are pronounced, additional voices, and support for multiple audio sources
● Additional text highlighting options in Speak Screen and Speak Selection, as well as the ability to speak keyboard letters and predictive typing suggestions to support multi-modal learning
● Switch control now lets you control iOS, macOS and tvOS all from the same iPhone or iPad, so you don’t need to configure switches for the secondary device
● Software TTY allows you to place and receive TTY calls without the need for traditional hardware teletypewriter accessories

Some features may not be available for all devices, countries or all areas, for more information visit: and

For information on the security content of this update, please visit this website:

Apple, Apple Watch, iOS, iPad, iPhone /

iOS 10 / 10.0.1 Direct Download Links

If you’d like to download the iOS 10 firmware files and perform a clean install (via iTunes) on your iDevice(s) then hit up the necessary links below:

Apple, Apple Watch, How To /

How to: Toggle Apple Watch between Miles and Kilometres

Kilometres (or kilometers depending on which version of English you use!) aren’t the distance measurement of choice for many citizens of this fair world. As a Brit I’m used to miles. Sure, it’s a throwback to days gone by, and despite the simplicity of the metric system, we just aren’t ready to let go of the imperial measurements for distance and weight!

When you start to use the activity tracking features of an Apple Watch, you’re probably going to want to swap the kilometres for miles. It’s not obvious how to do this, so lets step through it together.

On your Apple Watch, open the Activity App:

Home screen

Tap “Outdoor Walk” (or any of the other listed activities)

Selection screen

Swipe across until you get to the distance screen:

In kilometres

Press firmly on the screen (to engage force touch) and select miles:

Flip between Miles and Kilometres

That’s it, you’re done. See…

Showing miles

Repeat the process if you fancy being all metric.

Featured image credit: Hiné Mizushima (Flickr) Creative Commons

Apple, Apple Watch, Opinion /

Apple Watch bashing – the new cool amongst Apple tech writers?

The Apple Watch turned one last week. In the run up to its first birthday I noticed a build up of technology blog sites understandably using this opportunity to re-cap on the original launch, to speculate about a second generation device and reflect on the first year of ownership.

Initially, most sites seemed to re-visit posts that collated favourite apps / stuff the author can’t live without; however the tide swiftly turned from what were mostly positive comments into what I can only describe as the jumping on the bandwagon of “Apple Watch bashing”.

I’ve had my Apple Watch for a couple of months now. I was going to wait for the second generation before indulging, but I got a few weeks old watch for a bargain after a friend decided they didn’t want theirs. Why was I waiting for the second generation? Simply put, because nearly every new device Apple has launched in the last ten years has been seen as ground breaking or revolutionary.

Photo credit: Hiné Mizushima (Flickr) Creative Commons

Photo credit: Hiné Mizushima (Flickr) Creative Commons

Apple’s products have often been the first to market, or where they’ve been a later player, they’ve knocked the competition’s offering firmly into second place. Apple have achieved this by staying relatively close to Jobs’ mantra of only releasing products that are ready and fit for use by the non-techie.

In my opinion, every first generation Apple device has been great to see and very desirable (marketing works!). I’m also astutely aware though, that all of these first generation devices have been leapfrogged in terms of capability, functionality and desirability once the second generation was born.

Look at iPads – the first generation was chunky, thick and with flat edges. A lot was packed into the device and what you got on-screen was awesome, however on reflection, it was hideous compared to its younger brethren.

MacBooks have come a long way atheistically and capabilities wise too. I remember the old units and then, my first foray into MacBook ownership, the 2010 Pro with its fantastic screen, power and capability, but conversely its rough front edge (rubs the wrists) and limited memory upgrades. The wedge shape of newer models really appeals, memory wise we’ve still got issues with caps on maximum upgrades (and don’t get me started with soldering RAM to the boards!).

I could go on, but I digress from my point – the bandwagon of Apple Watch bashing. Why all the negativity compatriots in the writing world? Is the Watch really that bad? Don’t get me wrong, I’m no fanboy – I have plenty of Apple products but I recognise they are not the be-all and end-all of technology.

I have my list of gripes:

  • I find some non-native applications slow to open and unresponsive.
  • Glances don’t always work in the way I’d expect them to.
  • I’d like to customise my watch faces beyond the limited complications currently available.
  • I’d like to be able to get more out of the battery – two days would be fine rather than a day and a bit.
  • Developers haven’t been as swift as I’d like to expand their iOS apps to WatchOS additions

Despite these, I still enjoy wearing my watch. For sure, I probably don’t use as many of the non-native apps as much as I thought I would, but it’s still sat on my wrist on a daily basis.

Will I join the band of writers bashing the first generation Apple Watch? No, sorry – I recognise it’s not perfect, show me a first generation product that is. Do I think there’s a trend of copycat writing in order to tempt readers – absolutely and I’m sure that we will see the same thing happen on the anniversary of the iPad Pro launch too. If this lack of bashing means I don’t get to be part of the “new cool” I’m okay with that, I’m not sure I was part of the “old cool” either!

Featured Image Credit: Bill Alldredge (Flickr) Creative Commons

How To, Plex, Technology, Ubuntu /

How to: Fix Ubuntu repository error when running apt-get update

I look after several Ubuntu servers. A couple of them recently threw up an error whilst I was running routine repository updates.

In my specific situation, after running apt-get update I received the following message on my terminal:

An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: wheezy InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 0B38CE01521D8275

Failed to fetch

Some index files failed to download. They have been ignored, or old ones used instead.

This, simply put, is because one of the repositories I make use of no longer had a copy of the source server’s public key stored on my server.

To fix this, I made a note of the alphanumeric content after “NO_PUBKEY” from the error message. In my case, “0B38CE01521D8275”

I then typed the following command:

sudo apt-key adv –keyserver –recv-keys 0B38CE01521D8275

(You should replace the last part with the alphanumeric you captured above)

GPG error fixed

When I then re-ran the apt-get update command everything went back to working as desired.

I have a feeling that this may have been to do with Plex Server, given that I experienced the error on three Ubuntu servers running the home media server software and not on the Ubuntu servers I use as web servers.

If you’ve landed here following a Google search, what was the error or problem you were having that brought you here?

How To, Mac, OS X /

How to: Install OS X Leopard on a PPC Mac using an external USB device

iMac G5 Rebuilding

I recently got hold of a iMac G5 (PPC) that was heading for the recycling centre. I thought I’d have a go at restoring it.

Internet recovery or even local recovery wasn’t a thing until we got to Lion. Optical media was the way of the world when this bad boy was in service.

I didn’t have a Dual Layer DVD so, instead, I needed to install from a USB pen drive (8Gb or larger required). Again, with Snow Leopard and later OS X Operating Systems, it was relatively simple to make a bootable USB pen drive and install from it. Not the case with Leopard.

I had an image of the Leopard installation media in a DMG file. Despite using SuperDuper! and the standard Disk Utility Restore feature to try to make a bootable USB stick, the iMac wasn’t interested in seeing my USB device as bootable media when I powered up holding down the option key.

I spent some quality time with Google before managing to get the Operating System to re-install. Given all the hassle I had, I felt it worth sharing here:

1. Make sure your installation media (in my case the Mac OS X Install DVD 10.5.dmg file) is readily available on another Mac.

2. Connect your external drive to the Mac containing your source files and launch Disk Utility.

3. Select the drive in Disk Utility and then select the Partition tab. Make sure that the drive is formatted using an Apple Partition Map scheme, not GUID or MBR (you may need to reformat your drive to get it in this form).

4. Highlight the newly formatted drive within Disk Utility and select the Restore option under the Edit menu

5. Browse to your source DMG file

6. Click on restore. This may take a while to complete.

7. Determine the partition where your bootable image it situated. This might be disk1s3 in which case the partition number is 3. Also you can check it on Disk Utility, select the drive click the Info button and write down the ‘Partition Number.’

8. Eject the USB drive safely from your Mac and pop it into the iMac

9. Restart your iMac while holding down Command+Option+O+F. This will place you in Open Firmware.

10. Type dev / ls to get the device tree list.

Look for something in the output like:

As we’re talking about a tree here, write down the complete path to this node. In my case it would be:

11. Type devalias ud /ht/[email protected]/[email protected],1/[email protected]. In other words: make ‘ud’ equal to the path you found in step 10.

12. Now verify you got the right disk:

dir ud:3,\ 

(3 is the partition number you wrote down in step 7). And look for a file with tbxi attribute, probably in:

\System\Library\CoreServices\BootX, e.g.:

dir ud:3,\System\Library\CoreServices

13. Then boot from it:

boot ud:3,\System\Library\CoreServices\BootX


14. Wait a little bit – while the iMac restarts and if you see the Leopard Installer begin, you’re done.

Source materials that got me started are here


Photo credit for cover image: Matthew Pearce (Flickr) Creative Commons

Apple, How To, Mac, OS X /

How to: Add a iCloud Drive shortcut to the OS X dock

When iCloud Drive first came out I was frustrated by Apple stopping me from creating a shortcut to the path on my OS X dock. I dropped a tweet out knowing I’ve some developers amongst my Twitter followers and sure enough a solution prevailed.

All you need to do is fire up Terminal and paste this command:

ln -s  ~/Library/Mobile\ Documents/com~apple~CloudDocs ~/iCloud\ Shortcut; open ~/;

Then drag iCloud Shortcut to the right hand side of the Dock.

Kudos to James Pearson for his support achieving this. His page on this is here. He wrote this with Yosemite in mind, but it’s worked on every OS X version since for me.


Photo credit: Koizin (Flickr Creative Commons)

App Store, Apple, How To, iOS, iPad, iPhone, iTouch /

How to: Fix iOS not updating applications


There are occasions where our (mostly) perfect portable Apple iDevices (yes, I’m still using that term!) don’t quite work as we, or Apple, intended. One such instance is where a device gets it’s App Store credentials in a pickle.

I’m guessing you’ve landed here as a result of searching Google (other search engines are available) whilst seeking a solution to your iOS device not updating it’s App Store applications.

Typical examples of the problem include:

  • Apps no longer auto update despite your settings being configured to do so
  • Tapping “Update” against an app in your updates pending list results in brief glimpse of the update circle before “Update” reappears


Occasionally tapping the Update button repeatedly will see the update eventually take. In my experience this is limited to free apps.

On to the fix:

  • Open Settings
  • Scroll down and tap on “iTunes and App Store”
  • Tap your Apple ID when it appears at the top of the next screen
  • Tap “Sign out”
  • Once you’ve signed out you need to sign back in by tapping Apple ID again
  • Enter your email address assigned to your Apple ID and password

That’s it. You should now be able to update those troublesome stuck apps.

(Note: When I’ve seen this problem I have had a couple of occasions where I’ve had to force close an app before I can apply it’s update although this shouldn’t be necessary).

TL;DR – Log out of the App Store and back in again to refresh your credentials. Apple’s mechanism for checking if you’re entitled to the application installer has got itself in a pickle.


General, Site News /

Taking the site in a new direction


It’s time to take last place on the net in a new direction. Sam and I haven’t been posting to the site over the last few years. This has been for a number of reasons:

  • Our day jobs changed significantly
  • Family growth (I had a second child)
  • Neither of us have been using jailbroken iPhones

Whilst the last place on the net was never a specifically Apple Technology site, most of the content we shared here has been Apple related. Having recently caught up in person, we’ve confirmed we do both have an appetite for writing – we’d like to broaden our content and you should look forward to additional topics creeping in such as:

  • HP Microservers for home users (Hardware tips etc)
  • Setting up and managing home media streaming services
  • Ubuntu server for home use
  • Generic technology commentary, e.g. Sonos, Virtualisation, Gaming advances etc
  • Playstation / Xbox related items
  • Application reviews / recommendations based on our personal experiences (GTD, Fitness etc)
  • WordPress
  • Self hosting web-site tips / tuning etc

We haven’t yet decided if we will apply a new look to the site; the current theme is a few years old, and whist it still looks relatively clean and modern, we’d like to take advantage of how WordPress has evolved as our theme code is now pre-historic by comparison.

We’re on the waiting list for Facebook Instant Articles and Apple News. Fingers crossed we’ll get acceptance sooner rather than later so we can make sure our content is adapted for those ever-increasing platforms. (In time, I will probably write some guides for how to get WordPress to play nicely with them too).


Sam and Rob

Photo credit: m.a.r.c. (Flickr CC)