Hand Coded Studio Web Development Tips

View our work

Force composer to use a PHP version

If you have different versions of PHP running locally, and in production - it's advisable to fix your version of PHP. Otherwise you'll become out of sync and receive errors in production.

Add this to your 'composer.json' file, in the config 'block':


01 May 2018

Ubuntu time with ntp

If you need ntp to reset the server time on a Ubuntu server, run these commands:

sudo service ntp stop
sudo ntpd -gq
sudo service ntp start


19 February 2018

Fix Laravel: Specified key was too long

Laravel 5.4 made a change to the default database character set, and it’s now utf8mb4 which includes support for emojis. For those running MariaDB or older versions of MySQL you may hit this error when trying to run migrations:


12 February 2018

SQL to Delete WordPress Revisions

While building and testing your WordPress website, you're likely to build up a history of unwanted post revisions, clogging up your WordPress database. The SQL command below will remove those old revisions and associated post meta data.

This SQL statement can be very useful if you use Advanced Custom Fields. Remember to do a database backup first.


31 January 2018

Upgrading Ubuntu - "Error authenticating some packages"

Sometimes when upgrading Ubuntu you'll see this error message:

Error authenticating some packages
It was not possible to authenticate some packages. This may be a transient network problem. You may want to try again later. See below for a list of unauthenticated packages


30 January 2018

Laravel Forge iframe

When using Laravel Forge, the service helpfully sets up a strong NGINX file for you. This is very helpful, however it does add some interesting headers that stop the website being embedded into an iframe.


24 January 2018

Ubuntu server disk usage

Overtime web servers fill up with "stuff", whether than be application files, uploaded content, backups, log files or OS images. It's important to keep ontop of these to avoid your server crashing or grinding to a halt. These two command are very helpful to review disk usage:


16 October 2017