Tag: php

  • Upgrade PHP7.2 to PHP7.4 on Ubuntu running NGINX

    Upgrading PHP versions isn’t exactly an upgrade in the sense that you will end up with both PHP versions installed. Installing PHP7.4 won’t remove 7.2, you will have both and then you can configure your server to use 7.4. First, you’ll need to install PHP7.4 and all the related packages that you used in 7.2.…

  • Run multiple versions of PHP in XAMPP

    Download the required version of PHP from https://www.php.net/downloads.php. For PHP7+, you can download the Thread Safe version. For older PHP, try the Non Thread Safe version. Create another folder in C:\xampp for this version of PHP apart from the existing C:\xampp\php. E.g., C:\xampp\php74. Copy the downloaded version’s files into this folder Create php.ini in this…

  • Add custom post types to WordPress search

    Include custom post types in the search using WordPress hooks To include custom post types in the default search, we need to modify the search function using an action hook. Post types that we want to search through are added to the search query in an array. The array needs to include WordPress’s default post…

  • Highlight the current post’s tags in WordPress

    List all tags in a bulleted list and highlight only the current post’s tags. Highlight the current post’s tags using CSS The idea is to show all the tags used on the site and then add a CSS class to the tags that are used in the current post. This class can then be styled…

  • Fix PHP executable not set in VSCode when running XAMPP on Linux

    This is a fix for the following error when opening PHP files in VSCode or VSCodium: Cannot validate since no PHP executable is set. Use the setting ‘php.validate.executablePath’ to configure the PHP executable. This error means that VSCode does not know how to validate the contents of a PHP file and can’t show errors in…