While I was trying to upload some new photos onto my blog, I realized that all my photo sizes are gone. I use different sizes in blog posts and final tiles gallery as my portfolio so they are pretty important for me.
Uninstalling Simple Image Sizes and WP Smush did not help. Updating WordPress and all plugins to the latest did not help as well. So it had to be my Upgrading Ubuntu 14.04 to 16.04 for WordPress that messed it up.
After messing around on WordPress UI, I found another strange issue where my image editor inside the editor is also not working. So it might be related to some low-level libraries? I dug deeper and found someone with a similar issue:
The fix provided was for php 5, but on Ubuntu 16.04, neither php5-gd nor php5-imagick was available. So I went ahead and installed the latest version of php – php 7.3 following the Digital Ocean guide, with some minor tweaks:
1 2 3 4 5 |
$ sudo apt install php7.3 $ sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y $ sudo a2dismod php5.6 $ sudo a2enmod php7.3 $ sudo service apache2 restart |
And… of course, my WordPress homepage started crashing.
A quick sudo nano /var/www/wp-config.php to turn on debugging mode and I found out that the old Crayon Syntax Highlighter plugin stopped working with new php 7.3 syntax. There is manual fix online but I thought there has to be a simpler way. Following the issue on the original author aramk’s GitHub repo, I found a replacement plugin called Urvanov Syntax Highlighter (code repo on GitHub). Activating it fixed the error, but it didn’t seem to transfer the existing themes. So more bash scripts to the rescue:
1 2 |
$ cd /var/www/wp-content/uploads/crayon-syntax-highlighter/ $ sudo cp round-sublime ../../urvanov-syntax-highlighter/themes/ -r |
Now everything works again (hopefully)!