How to upgrade PHP 7.4 for XAMPP on Windows

133 Likes Comment

I’m trying to activate Contact Form 7 Dynamic Text Extension, but no way to success. It’s worth noting that upgrading to PHP 7.4 or higher is recommended for security, performance, and compatibility reasons. It ensures you can take advantage of the latest features and improvements in the PHP language.

  1. Performance and Efficiency: PHP 7.4 brings significant performance improvements and efficiency enhancements compared to earlier versions. Plugins that require PHP 7.4 can take advantage of these optimizations to deliver faster and more efficient functionality.
  2. Modern Language Features: PHP 7.4 introduces new language features and syntax improvements that enhance developers’ ability to write clean, concise, and modern code. Plugins may require these features to leverage the latest coding techniques and ensure compatibility with other modern WordPress tools and frameworks.
  3. Security Enhancements: Keeping PHP up to date is crucial for maintaining a secure environment. PHP 7.4 includes security patches and fixes for vulnerabilities found in earlier versions. Plugins that require PHP 7.4 ensure that they can benefit from the latest security enhancements and protect your WordPress site against potential threats.
  4. Compatibility with WordPress and Other Plugins: As WordPress evolves, it gradually drops support for older PHP versions and encourages developers to utilize the latest stable releases. By requiring PHP 7.4, plugins ensure compatibility with the most recent WordPress versions and other plugins that adopt the latest PHP standards.
  5. Long-term Support: PHP 7.4 is actively supported by the PHP development team, which means it receives bug fixes, security updates, and improvements. Plugins that require PHP 7.4 provide you with ongoing support and maintenance, ensuring compatibility with future PHP releases.

To upgrade PHP 7.4 with XAMPP on Windows, you’ll need to follow these steps:

  1. Backup your existing XAMPP installation: It’s always a good idea to create a backup of your XAMPP installation folder in case anything goes wrong during the upgrade process. You can simply make a copy of the entire XAMPP folder and save it in a safe location.
  2. Download the PHP 7.4 version: Visit the official PHP website (https://www.php.net/downloads.php) and download the Windows VC15 x64 Non Thread Safe version of PHP 7.4.
  3. Stop the XAMPP services: Open the XAMPP Control Panel and stop all the running services (Apache, MySQL, etc.) by clicking on the “Stop” button next to each service.
  4. Locate the PHP folder in XAMPP: In your XAMPP installation folder, navigate to the “php” directory (e.g., C:\xampp\php).
  5. Rename the existing PHP folder: To keep a backup of the old PHP version, rename the existing “php” folder to something like “php_old”.
  6. Extract the downloaded PHP files: Extract the contents of the downloaded PHP 7.4 zip file and copy all the files and folders from the extracted folder.
  7. Paste the extracted PHP files: Paste the copied PHP files and folders into the XAMPP installation directory’s “php” folder (e.g., C:\xampp\php).
  8. Configure PHP in XAMPP: Open the “php.ini” file located in the “php” folder (e.g., C:\xampp\php\php.ini) using a text editor. Make sure the following settings are updated or added:
    • Find the line extension_dir = "./" and change it to extension_dir = "ext".
    • Find the line ;extension=mysqli and remove the semicolon at the beginning to enable the MySQLi extension. Configure as: extension=”C:/xampp/php/ext/php_mysqli.dll”
    • Find the line ;extension=openssl and remove the semicolon at the beginning to enable the OpenSSL extension. Configure as: extension="C:/xampp/php/ext/php_openssl.dll"
    • Save the changes and close the file.
  9. Start XAMPP services: Open the XAMPP Control Panel and start the Apache and any other required services by clicking on the “Start” button next to each service.
  10. Verify the PHP version: Open a web browser and navigate to http://localhost/phpinfo.php. Create a new file named “phpinfo.php” in the “htdocs” folder of your XAMPP installation (e.g., C:\xampp\htdocs\phpinfo.php) and add the following content to it:phpCopy code<?php phpinfo(); ?> Save the file and then access http://localhost/phpinfo.php in your browser. It should display the PHP information, including the new PHP 7.4 version.

By following these steps, you should be able to upgrade PHP to version 7.4 in your XAMPP installation on Windows. Remember to test your websites and applications after the upgrade to ensure everything is functioning as expected.

You might like

Avatar

About the Author: Toc Xoan

Leave a Reply

Your email address will not be published. Required fields are marked *