How to replace an Amazon EC2 instance running CentOS and Plesk

In this video I will show you how you can replace a running EC2 instance with a larger one. You may want to do this if you find that you need bigger and better hardware to serve your website, or to move from a development system to a more powerful production system. In this example … Read more

How to log into MySQL as root user in Plesk

You may have noticed that there is no MySQL root user on servers running Plesk. That’s because Plesk renames this user into “admin” by default – for security reasons. The password for the admin MySQL account is the same as for the Plesk Panel admin account. Even so, when you try to login to MySQL … Read more

How to replace and add HTML text elements with CSS

In some circumstances you may can replace HTML text elements via CSS. This is useful if you don’t have access to the source files, or if you want to override text in a Child Theme’s stylesheet. There are several approaches to this conundrum, I’ll show you two of them. Both require that you have a … Read more

How to switch between several PHP versions in MAMP 2.x

mamp logoSometimes you need to test your projects against multiple versions of PHP.

If you’re using MAMP that’s fairly easy to do: head over to the MAMP Start Screen, select Preferences and see two versions to choose from.

Here I’m using MAMP 2.2 (even though 3.x has been released already) and I have PHP 5.2.17 and PHP 5.5.3.

When I switch to the other version MAMP restarts and I can refresh my browser to see my project running on the other PHP version.

Screen Shot 2014-03-20 at 08.31.06

Screen Shot 2014-03-20 at 08.31.12

That’s all good if I actually needed either version – but sadly 5.2.x is too old for me, and 5.5.x doesn’t quite work and is a bit too cutting edge. I need it to reflect my production environment.

So what is a boy to do?

Read more

How to check the size of a file in PHP

PHP has a handy function called filesize() which can help us display how big a file is. It does this in bytes by default, but with a bit of tinkering we can easily convert this into kilobytes or megabytes. Let’s first see how this works in bytes: $file = ‘/path/to/your/file’; $filesize = filesize($file); echo “The … Read more