Are you making any websites on WordPress? WordPress is a great content management system and is a choice for millions of developers.
While it is super easy to get started on WordPress, sometimes the developers or content creators face issues that are hard to diagnose and easy to resolve.
One such issue is if your hosting supports multiple versions then the php version may get overridden in case you are not taking care of the following small thing.
Anything that is written between the following directives in .htaccess file will be overridden by wordpress.
# Begin Wordpress
// Do not put anything custom here. This section will be overridden by Wordpress
# End Wordpress
And how do you specify the version that you want to use for your wordpress? Here is what you should do
e.g using php 7.4
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
# php -- END cPanel-generated handler, do not edit
e.g using php 8.1
# php – BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml
# php – END cPanel-generated handler, do not edit