Resize not working on Digital Ocean server

I’m deploying Kirby on a Digital Ocean droplet (Ubuntu 20.04) running Apache. When I use the helper tag resize locally it works fine and creates image thumbnails under /media but when I run the site on production it only creates a .jobs folder in the /media directory.

So far I’ve tried:

  • Changing folder permissions to 755 and files to 644.
  • Deleting the /media folder on the server and letting it regenerate.

Here’s the code I’m using in my template:

<?php foreach($page->children()->paginate(20) as $artwork): ?>
  <?php foreach($artwork->images()->limit(1) as $image): ?>
      <img src="<?= $image->resize(450)->url() ?>" />
  <?php endforeach ?>
<?php endforeach ?>

Again, locally this works fine but on the server the image url defaults to the original hires image.

Here’s what the /media folder on the server looks like:

Am I missing something or has anyone else experienced this? Also if anyone has suggestions on other methods of debugging this problem please let me know. Thanks!

Found out what was happening. I hadn’t installed php-gd. This thread helped. I see now that its listed under requirements.

Also if anyone else is struggling with running Kirby on Digital Ocean I’d recommend this article. Thinking about publishing an updated version for Kirby 3.