DirectAdmin, PHP 8.4 and WordPress: Adding AVIF Support

As of WordPress 6.5, native AVIF support makes it easier than ever to leverage this modern format. However, for those using control panels like DirectAdmin, additional steps may be required to unlock AVIF's full potential.

Alby Andersen

We know that WordPress provides native AVIF support as of version 6.5. If you are using ready-made WordPress installations from services like Vultr or DigitalOcean, you will most likely be able to upload images with AVIF extension without any problems.

wordpress avif support directadmin
PHP 8.+ versions in CustomBuild 2.0 are build without AVIF support.

However, if you are using a web hosting control panel like DirectAdmin, we have a small problem. This is because PHP 8.x versions installed with DirectAdmin are not compiled with AVIF support. To solve this problem, you need to make a small change and recompile PHP 8.2, 8.3 or 8.4. Here are the instructions:

How to add AVIF support to WordPress using PHP 8.4

System specifications: Ubuntu 24, DirectAdmin 1.673, PHP 8.4, WordPress 6.7.

  1. Log in to DirectAdmin as admin.
  2. Go to CustomBuild under Extra Features and then to Compilation.
DirectAdmin, PHP 8.4 and Ubuntu: Adding AVIF support
  1. Find the PHP 8.4 section here and click Customize.
wordpress php 8.4 avif support
  1. In this step, add the –with-avif \ line below the –enable-gd \ and save
  2. Go back to CustomBuild and enter Build.
DirectAdmin, PHP 8.4 and Ubuntu: Adding AVIF support
  1. In the last step, click Build and recompile PHP 8.4 with AVIF support. It will take 5-10 minutes depending on the server speed.
  2. After the installation is finished, enter the WordPress admin page. Here, click on the Info tab by following the Tools – Site Health path.
DirectAdmin, PHP 8.4 and Ubuntu: Adding AVIF support
  1. Expand the Media Handling section and you will see that AVIF support is enabled.
Share This Article