Configuring PHP Modules for AVIF Support on WPCloud

How to enable required PHP modules for AVIF image support using CloudLinux PHP Selector.

Complete Guide to AVIF Image Support on WPCloud

ย 

Overview

While WordPress 6.5 introduced native AVIF image support, proper server configuration is required to handle these files. This guide covers everything you need to know about AVIF support on WPCloud hosting platforms.

Requirements

WordPress Version

  • WordPress 6.5 or higher required for AVIF support
  • WordPress 6.7+ recommended for optimal performance

PHP Configuration

  • Minimum PHP Version: 8.1
  • Recommended PHP Version: 8.2 or 8.3
  • Required PHP Modules: (Enabled by default)
    • gd (with AVIF support)
    • fileinfo
    • imagick

Configuration Steps

Update PHP Version

  1. Log into cPanel
  1. Navigate to "Select PHP Version"
  1. Choose PHP 8.1 or higher
  1. Click "Apply"

Important Note: On WPCloud, all required modules (gd, fileinfo, imagick) are enabled by default. If you encounter AVIF upload issues, simply:

  1. Click "Reset to Default" in PHP Selector after changing PHP versions
  1. This automatically enables all required modules with optimal settings

There's no need to manually enable modules unless you've previously modified the default configuration.

Troubleshooting

Common Error Messages

If you see: "This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading"

Possible Causes:

  1. PHP version below 8.1
  1. Non-default PHP module configuration
  1. Server-level image processing limitations

Solutions

Immediate Workarounds

  1. Convert AVIF to WebP format (similar compression benefits)
  1. Use standard JPEG/PNG formats temporarily
  1. Contact support for server-side verification

For Advanced Users

If you need to use original AVIF images:

wp_get_attachment_image($image_id, 'original_image');

Best Practices

  1. Keep original images in standard formats (JPEG/PNG)
  1. Use WebP as fallback when AVIF isn't supported
  1. Regularly verify PHP configuration
  1. Test AVIF uploads after any PHP version changes

Performance Notes

  • AVIF offers superior compression compared to JPEG and PNG
  • Server-side processing of AVIF images may require more resources
  • Consider using WebP as a balanced alternative

Support Options

If you continue experiencing issues:

  1. Open Support Ticket:
  1. Include in Your Ticket:
      • WordPress version
      • Current PHP version
      • Exact error message
      • Sample AVIF file (if possible)

Related Resources

  • WordPress 6.5+ Documentation
  • PHP GD Documentation

Note: This article is regularly updated to reflect the latest WPCloud hosting environment configurations and WordPress requirements.

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ

Last updated on November 26, 2024