Hand Coded Studio Web Development Tips

View our work

Debugging WordPress

WordPress will often hide errors, however you can display them by adding these lines to the wp-config.php file:

define( 'WP_DEBUG', true );
define( 'SCRIPT_DEBUG', true );

Read more...

11 May 2018

Clear broken Ubuntu dependencies using Aptitude

I found that the only thing that worked for me was using Aptitude.

Then when it opens it will usually say something about unmet dependencies on the bottom. You can hit the letter g to proceed with the suggested removal. It will take you to a page where it lists what is going to happen.

Read more...

10 May 2018

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':

Read more...

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

Read more...

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:

Read more...

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.

Read more...

31 January 2018