Years ago we migrated our sites from MySQL to MariaDB and quickly decided to move legacy MyISAM tables over to the crash-safe Aria storage engine. Unlike MyISAM, Aria uses transactional logging and page checksums, making it far more resilient after unexpected power loss or server reboots.

Below are two clean ways to batch-convert all MyISAM tables to Aria: pure SQL right from the console (the safest route) and a modernized PHP 8 mysqli script.
Read full article →
Debian 9 installs PHP 7.0 by default. That’s already good: according to the PHP developers, PHP 7 is up to twice as fast as PHP 5.6, and you could stop right there.
But you always want more, don’t you? And there is a way!

You can install PHP 7.1, 7.2 or 7.3, and it’s version 7.3 that gives the best speed. Besides, official support for PHP 7.0 already ended on 10 January 2019.
Read full article →
At some point, after all my optimization and speed-up work on the blog, I noticed that WordPress had stopped resizing uploaded photos to 600 px and the other standard sizes: only the original ended up in the media library.

I uploaded the sizes I needed by hand a few times and realized that wasn’t going to work – it had to be fixed. The cause turned out to be simple: after the switch to PHP 7.3, the server had no module for working with images.
Read full article →
Every time I set up a new server, something has been updated. This time Apache 2.4 replaced Apache 2.2, which used to be the default.

The configuration changed a bit in version 2.4, so simply copying the “old configs” and virtual host files won’t be enough.
In Apache 2.4 you get the error AH01630: client denied by server configuration.
Read full article →
Debian 9, phpMyAdmin 4.9. Instead of installing phpMyAdmin from packages, we just unpack it from the archive, log in to the empty database as root for the first time and get an error:
mysqli_real_connect(): (HY000/1698):
Access denied for user 'root'@'localhost'
In short: on Debian and Ubuntu, the MariaDB/MySQL root user logs in by default not with a password but through the socket – by the operating system user name (the unix_socket or auth_socket plugin). From the console as root everything works, but phpMyAdmin runs as www-data, so the server rejects it. The fix is to create a separate user with a password for phpMyAdmin or to set a password for root.

Below: why it happens, two proper solutions, and the old method that many people still recommend even though it is unsafe.
Read full article →