Live Chat

Domain Scan

(empty)

Login


PHP 8.4 Released: What's New and How to Enable It in cPanel

PHP 8.4 Released: What's New and How to Enable It in cPanel
(08-jan-2025)

PHP 8.4 Released: What's New and How to Enable It in cPanel with Register.lk

November 2024 has been an exciting month for PHP developers with the highly anticipated release of PHP 8.4. This new version brings innovative features, performance enhancements, and bug fixes that elevate the language's capabilities. Even better, PHP 8.4 is now available in cPanel, making it easier than ever for developers and hosting providers to upgrade their environments. Here's what you need to know.

Key Features of PHP 8.4

PHP 8.4 introduces a variety of enhancements and new features designed to improve developer productivity and application performance. Based on the official release notes, here are some of the standout updates:
  1. Property Hooks: This feature allows developers to define custom behavior when setting or getting class properties, providing greater control over property access and assignment. With property hooks, you can intercept read (get), write (set), or unset (unset) operations on class properties. This eliminates the need for magic methods like _get(), _set(), and _unset() when dealing with dynamic behavior. Instead, hooks offer a more structured and type-safe approach.

  2. Asymmetric Visibility: The Asymmetric Visibility feature introduced in PHP 8.4 enhances encapsulation by allowing developers to define different visibility levels for reading and writing a class property. This means you can specify one level of access (public, protected, private) for getting the property value and another for setting it.

  3. #[\Deprecated] Attribute: The #[\Deprecated] attribute enables developers to explicitly mark user-defined functions, methods, or class constants as deprecated. This attribute aligns user-defined deprecations with PHP's built-in deprecation warnings. When code interacts with a deprecated element, a deprecation notice is triggered, helping developers identify and replace outdated code.

  4. New ext-dom features and HTML5 support: The ext-dom extension now offers better compliance with HTML5 specifications. Developers can process and manipulate HTML5 documents more effectively, including handling new elements and attributes introduced in HTML5.

  5. Performance Enhancements: PHP 8.4 includes various improvements, resulting in faster execution of scripts and more efficient resource utilization.

  6. Bug Fixes and General Cleanup: This release addresses and includes general codebase cleanups, contributing to increased stability and reliability.

Why Upgrade to PHP 8.4?

Upgrading to PHP 8.4 is highly recommended for the following reasons:
  • Improved Performance: Faster execution times mean better user experiences and reduced server costs.

  • Modern Features: Leverage the latest tools to build robust and scalable applications.

  • Long-term Support: Stay up-to-date with the latest security patches and compatibility updates.

How to Enable PHP 8.4 in cPanel

Before updating your PHP version, it's essential to create a full backup of your cPanel account. This is crucial because if anything goes wrong during the update, you can restore your website to its previous state without any data loss. Once the PHP version is successfully updated, you can either delete the backup file from the server to free up space or download it to your local device and then remove it from the server.
Follow these steps to switch to PHP 8.4:
  1. Log in to cPanel: Access your hosting account and log in to the cPanel dashboard.
  2. Navigate to the MultiPHP Manager: Under the "Software" section, click on "MultiPHP Manager."
  3. Select Your Domain: In the MultiPHP Manager interface, you'll see a list of your hosted domains. Select the domain you want to upgrade.
  4. Choose PHP 8.4: From the PHP version dropdown menu, select "PHP 8.4."
  5. Apply Changes: Click on "Apply" to save your changes. Your site will now run on PHP 8.4.
  • For more detailed information about PHP 8.4, please refer to the official documentation by clicking here.
  • For a detailed explanation of why updating your PHP version in cPanel is crucial, check out our article: "Why You Should Always Update Your PHP Version to the Latest in cPanel".


  • Conclusion

    PHP 8.4 is a testament to the language's evolution, offering developers a more powerful and efficient platform to build modern applications. With its availability in cPanel, upgrading is a seamless process that unlocks new opportunities for performance and innovation.

    Don't wait-start exploring PHP 8.4 today and take your web development projects to the next level.


    Written by: Register.lk Support Hero - Shamendra
    BACK 2 BLOG